Error: Not implemented: window.scrollTo. How do we remove this error from Jest test?

Try running the jest command with --env=jsdom. This will mock most browser functions and will solve your issues.

There are more ways of setting the test environment, take a look at:


This worked for the window.scrollTo errors

Leave a Comment