

Refer to the micromatch documentation to ensure your globs are compatible. Most likely your glob patterns are not matching any files.

See the coverageProvider option for more details. Jest ships with two coverage providers: babel (default) and v8. Because this retrofits all executed files with coverage collection statements, it may significantly slow down your tests. Indicates whether the coverage information should be collected while executing the test. This does not remove any mock implementation that may have been provided. Equivalent to calling jest.clearAllMocks() before each test. clearMocks Īutomatically clear mock calls, instances, contexts and results before every test. This config option lets you customize where Jest stores that cache data on disk. Jest attempts to scan your dependency tree once (up-front) and cache it in order to ease some of the filesystem churn that needs to happen while running tests. The directory where Jest should store its cached dependency information. Setting bail to true is the same as setting bail to 1. The bail config option can be used here to have Jest stop running tests after n failures. bail īy default, Jest runs all tests and produces all errors into the console upon completion. They can be mocked explicitly, like jest.mock('fs'). Node.js core modules, like fs, are not mocked by default.
PACKAGE JSON WORKSPACES MANUAL
Node modules are automatically mocked when you have a manual mock in place (e.g.: _mocks_/lodash.js). All modules used in your tests will have a replacement implementation, keeping the API surface. This option tells Jest that all imported modules in your tests should be mocked automatically.
