While doing the upgrade to Angular 11, a couple of other packages like jasmine-core has also been upgraded. Due to which while running the 'npm run test' command causing various lint issue as they have made the 'types' more strict.
One of the issues is with window.scrollBy() method. As per the type definition file (lib.dom.ts), it can have 2 overloaded implementations like below -
scrollBy(options?: ScrollToOptions): void;
scrollBy(x: number, y: number): void;
But while writing the unit test case, it is giving Lint error as below -
it('should scroll down by 10 units', fakeAsync(() => {
service.scrollDown(10);
expect(window.scrollBy).toHaveBeenCalledWith({
top: 10,
left: 0,
behavior: 'smooth',
});
}));
It looks like it is considering only the second overloaded implementation, not the first one where we can also pass only parameter i.e. "options". Although the test case is getting passed correctly.
I have created a minimal reproduction example on below Github link. Please let me know in-case any additional information required. Any help or pointers would be really appreciated.
