1.0.0 • Published 7 years ago
jest-env-jsdom-silent v1.0.0
Silent JSDOM environment for Jest
Why
- There are a lot of JSDOM "Not Implemented" errors flooding my Jest test console.
- I want to keep this to a very minimal, so suppressing JSDOM's internal errors needed to be done.
Caveats
jsdomErrors
are fired for many other cases as well, besides JavaScript errors. E.g. failed CSS parsing or image loading.- If that matters to you, don't use this! See this
How to use
- Add to your project
npm install --save jest-env-jsdom-silent
OR
yarn add jest-env-jsdom-silent
- In your project's jest config set the
testEnvironment
tojest-env-jsdom-silent
"jest": {
...
"testEnvironment": "jest-env-jsdom-silent"
...
}
OR
If you are using CRA/passing via cli options
jest -- --env=jest-env-jsdom-silent