console.error node_modules/jsdom/lib/jsdom/virtual-console.js:29 Error: Not implemented: window.scrollTo at module.exports (/Users/me/Projects/my-project/node_modules/jsdom/lib/jsdom/browser/not-implemented.js:9:17) at /Users/me/Projects/my-project/node_modules/jsdom/lib/jsdom/browser/Window.js:594:7
Because we are using
Not implemented Navigation for:
window.location.replace(externa_link) same error happens with
I tried googling for solutions with react-router, but all examples use some component which contains
Is there a way to avoid this error? Or hide it?
I did some research and found that the Facebook team isn’t going to address it. Is there a way to suppress these errors/warnings when running
Our code doesn’t break and all tests pass otherwise.
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