![]() This asynchronous function receives a list of test paths which can be manipulated to exclude tests from running by returning an object with shape. Path to a module exporting a filtering function. Use this flag to show full diffs and errors instead of a patch. Make calling deprecated APIs throw helpful error messages. Examples: jsdom, node or path/to/my-environment.js. This can point to any file or node module. This option has a significant performance penalty and should only be used for debugging. This implies -runInBand, making tests run serially. Use this in cases where you need to use -forceExit in order for Jest to exit to potentially track down the reason. detectOpenHandles Īttempt to collect and print open handles preventing Jest from exiting cleanly. Print debugging info about your Jest config. Allowed values are babel (default) or v8. Indicates which provider should be used to instrument code for coverage. The directory where Jest should output its coverage files. Optionally pass to override option set in configuration. Indicates that test coverage information should be collected and reported in the output. This can also be a JSON-encoded value which Jest will use as configuration. If no rootDir is set in the config, the directory containing the config file is assumed to be the rootDir for the project. The path to a Jest config file specifying how to find and execute tests. The use of FORCE_COLOR overrides all other color support checks. The default cache directory can be found by calling jest -showConfig.Īlternatively you can set the environment variable FORCE_COLOR=true to forcefully enable or FORCE_COLOR=false to disable colorized output. ![]() Will delete cacheDirectory if the option is passed, or Jest's default cache directory. clearCache ĭeletes the Jest cache directory and then exits without running tests. Instead of the regular behavior of storing a new snapshot automatically, it will fail the test and require Jest to be run with -updateSnapshot. This changes the behavior when a new snapshot is encountered. When this option is provided, Jest will assume it is running in a CI environment. If the current branch has diverged from the given branch, then only changes made locally will be tested. Runs tests related to the changes since the provided branch or commit hash. Runs tests related to the current changes and the changes made in the last commit. If you need to clear the cache, use -clearCache. If you want to inspect the cache, use -showConfig and look at the cacheDirectory value. On average, disabling the cache makes Jest at least two times slower. The cache should only be disabled if you are experiencing caching related problems. Exit the test suite immediately upon n number of failing test suite. On Windows, you will need to use / as a path separator or escape \ as \\. Depending on your terminal, you may need to quote this argument: jest "my.*(complex)?pattern". Only the files that the pattern matches will be picked up and executed. It is possible to run test suites by providing a pattern. When you run jest with an argument, that argument is treated as a regular expression to match against files in your project.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |