Do that by adding a key called “jest” in your package.json and write it like this:
That will make your test run about 2X faster when you do a full test suite run and that can be a benefit if you have a lot of tests!
Now however will
document be undefined, so any test that depend on the DOM will be null or have a reference error.
You can read more about the settings of jest here and other cool settings like