@Generated(value="jsii-pacmak/1.47.0 (build 86d2c33)", date="2021-12-20T00:39:28.836Z") @Stability(value=Experimental) public interface JestConfigOptions extends software.amazon.jsii.JsiiSerializable
| Modifier and Type | Interface and Description |
|---|---|
static class |
JestConfigOptions.Builder
A builder for
JestConfigOptions |
static class |
JestConfigOptions.Jsii$Proxy
An implementation for
JestConfigOptions |
| Modifier and Type | Method and Description |
|---|---|
static JestConfigOptions.Builder |
builder() |
default Boolean |
getAutomock()
(experimental) This option tells Jest that all imported modules in your tests should be mocked automatically.
|
default Object |
getBail()
(experimental) By default, Jest runs all tests and produces all errors into the console upon completion.
|
default String |
getCacheDirectory()
(experimental) The directory where Jest should store its cached dependency information.
|
default Boolean |
getClearMocks()
(experimental) Automatically clear mock calls and instances before every test.
|
default Boolean |
getCollectCoverage()
(experimental) Indicates whether the coverage information should be collected while executing the test.
|
default List<String> |
getCollectCoverageFrom()
(experimental) An array of glob patterns indicating a set of files for which coverage information should be collected.
|
default String |
getCoverageDirectory()
(experimental) The directory where Jest should output its coverage files.
|
default List<String> |
getCoveragePathIgnorePatterns()
(experimental) An array of regexp pattern strings that are matched against all file paths before executing the test.
|
default String |
getCoverageProvider()
(experimental) Indicates which provider should be used to instrument code for coverage.
|
default List<String> |
getCoverageReporters()
(experimental) A list of reporter names that Jest uses when writing coverage reports.
|
default CoverageThreshold |
getCoverageThreshold()
(experimental) Specify the global coverage thresholds.
|
default String |
getDependencyExtractor()
(experimental) This option allows the use of a custom dependency extractor.
|
default Object |
getDisplayName()
(experimental) Allows for a label to be printed alongside a test while it is running.
|
default Boolean |
getErrorOnDeprecated()
(experimental) Make calling deprecated APIs throw helpful error messages.
|
default List<String> |
getExtraGlobals()
(experimental) Test files run inside a vm, which slows calls to global context properties (e.g.
|
default List<String> |
getForceCoverageMatch()
(experimental) Test files are normally ignored from collecting code coverage.
|
default Object |
getGlobals()
(experimental) A set of global variables that need to be available in all test environments.
|
default String |
getGlobalSetup()
(experimental) This option allows the use of a custom global setup module which exports an async function that is triggered once before all test suites.
|
default String |
getGlobalTeardown()
(experimental) This option allows the use of a custom global teardown module which exports an async function that is triggered once after all test suites.
|
default HasteConfig |
getHaste()
(experimental) This will be used to configure the behavior of jest-haste-map, Jest's internal file crawler/cache system.
|
default Boolean |
getInjectGlobals()
(experimental) Insert Jest's globals (expect, test, describe, beforeEach etc.) into the global environment.
|
default Number |
getMaxConcurrency()
(experimental) A number limiting the number of tests that are allowed to run at the same time when using test.concurrent.
|
default List<String> |
getModuleDirectories()
(experimental) An array of directory names to be searched recursively up from the requiring module's location.
|
default List<String> |
getModuleFileExtensions()
(experimental) An array of file extensions your modules use.
|
default Map<String,Object> |
getModuleNameMapper()
(experimental) A map from regular expressions to module names or to arrays of module names that allow to stub out resources, like images or styles with a single module.
|
default List<String> |
getModulePathIgnorePatterns()
(experimental) An array of regexp pattern strings that are matched against all module paths before those paths are to be considered 'visible' to the module loader.
|
default List<String> |
getModulePaths()
(experimental) An alternative API to setting the NODE_PATH env variable, modulePaths is an array of absolute paths to additional locations to search when resolving modules.
|
default Boolean |
getNotify()
(experimental) Activates notifications for test results.
|
default String |
getNotifyMode()
(experimental) Specifies notification mode.
|
default String |
getPreset()
(experimental) A preset that is used as a base for Jest's configuration.
|
default String |
getPrettierPath()
(experimental) Sets the path to the prettier node module used to update inline snapshots.
|
default List<Object> |
getProjects()
(experimental) When the projects configuration is provided with an array of paths or glob patterns, Jest will run tests in all of the specified projects at the same time.
|
default List<Object> |
getReporters()
(experimental) Use this configuration option to add custom reporters to Jest.
|
default Boolean |
getResetMocks()
(experimental) Automatically reset mock state before every test.
|
default Boolean |
getResetModules()
(experimental) By default, each test file gets its own independent module registry.
|
default String |
getResolver()
(experimental) This option allows the use of a custom resolver.
|
default Boolean |
getRestoreMocks()
(experimental) Automatically restore mock state before every test.
|
default String |
getRootDir()
(experimental) The root directory that Jest should scan for tests and modules within.
|
default List<String> |
getRoots()
(experimental) A list of paths to directories that Jest should use to search for files in.
|
default String |
getRunner()
(experimental) This option allows you to use a custom runner instead of Jest's default test runner.
|
default List<String> |
getSetupFiles()
(experimental) A list of paths to modules that run some code to configure or set up the testing environment.
|
default List<String> |
getSetupFilesAfterEnv()
(experimental) A list of paths to modules that run some code to configure or set up the testing framework before each test file in the suite is executed.
|
default Number |
getSlowTestThreshold()
(experimental) The number of seconds after which a test is considered as slow and reported as such in the results.
|
default String |
getSnapshotResolver()
(experimental) The path to a module that can resolve test<->snapshot path.
|
default List<String> |
getSnapshotSerializers()
(experimental) A list of paths to snapshot serializer modules Jest should use for snapshot testing.
|
default String |
getTestEnvironment()
(experimental) The test environment that will be used for testing.
|
default Object |
getTestEnvironmentOptions()
(experimental) Test environment options that will be passed to the testEnvironment.
|
default Number |
getTestFailureExitCode()
(experimental) The exit code Jest returns on test failure.
|
default List<String> |
getTestMatch()
(experimental) The glob patterns Jest uses to detect test files.
|
default List<String> |
getTestPathIgnorePatterns()
(experimental) An array of regexp pattern strings that are matched against all test paths before executing the test.
|
default Object |
getTestRegex()
(experimental) The pattern or patterns Jest uses to detect test files.
|
default String |
getTestResultsProcessor()
(experimental) This option allows the use of a custom results processor.
|
default String |
getTestRunner()
(experimental) This option allows the use of a custom test runner.
|
default String |
getTestSequencer()
(experimental) This option allows you to use a custom sequencer instead of Jest's default.
|
default Number |
getTestTimeout()
(experimental) Default timeout of a test in milliseconds.
|
default String |
getTestURL()
(experimental) This option sets the URL for the jsdom environment.
|
default String |
getTimers()
(experimental) Setting this value to legacy or fake allows the use of fake timers for functions such as setTimeout.
|
default Map<String,Object> |
getTransform()
(experimental) A map from regular expressions to paths to transformers.
|
default List<String> |
getTransformIgnorePatterns()
(experimental) An array of regexp pattern strings that are matched against all source file paths before transformation.
|
default List<String> |
getUnmockedModulePathPatterns()
(experimental) An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them.
|
default Boolean |
getVerbose()
(experimental) Indicates whether each individual test should be reported during the run.
|
default Boolean |
getWatchman()
(experimental) Whether to use watchman for file crawling.
|
default List<String> |
getWatchPathIgnorePatterns()
(experimental) An array of RegExp patterns that are matched against all source file paths before re-running tests in watch mode.
|
default com.fasterxml.jackson.databind.node.ObjectNode |
getWatchPlugins()
Default: -
|
@Stability(value=Experimental) @Nullable default Boolean getAutomock()
All modules used in your tests will have a replacement implementation, keeping the API surface
Default: - false
@Stability(value=Experimental) @Nullable default Object getBail()
The bail config option can be used here to have Jest stop running tests after n failures. Setting bail to true is the same as setting bail to 1.
Default: - 0
@Stability(value=Experimental) @Nullable default String getCacheDirectory()
Default: - "/tmp/
@Stability(value=Experimental) @Nullable default Boolean getClearMocks()
Equivalent to calling jest.clearAllMocks() before each test. This does not remove any mock implementation that may have been provided
Default: true
@Stability(value=Experimental) @Nullable default Boolean getCollectCoverage()
Because this retrofits all executed files with coverage collection statements, it may significantly slow down your tests
Default: true
@Stability(value=Experimental) @Nullable default List<String> getCollectCoverageFrom()
Default: - undefined
@Stability(value=Experimental) @Nullable default String getCoverageDirectory()
Default: "coverage"
@Stability(value=Experimental) @Nullable default List<String> getCoveragePathIgnorePatterns()
If the file path matches any of the patterns, coverage information will be skipped
Default: "/node_modules/"
@Stability(value=Experimental) @Nullable default String getCoverageProvider()
Allowed values are babel (default) or v8
Default: - "babel"
@Stability(value=Experimental) @Nullable default List<String> getCoverageReporters()
Any istanbul reporter can be used
Default: - ["json", "lcov", "text", "clover"]
@Stability(value=Experimental) @Nullable default CoverageThreshold getCoverageThreshold()
This will be used to configure minimum threshold enforcement for coverage results. Thresholds can be specified as global, as a glob, and as a directory or file path. If thresholds aren't met, jest will fail.
Default: - undefined
@Stability(value=Experimental) @Nullable default String getDependencyExtractor()
It must be a node module that exports an object with an extract function
Default: - undefined
@Stability(value=Experimental) @Nullable default Object getDisplayName()
Default: - undefined
@Stability(value=Experimental) @Nullable default Boolean getErrorOnDeprecated()
Useful for easing the upgrade process.
Default: - false
@Stability(value=Experimental) @Nullable default List<String> getExtraGlobals()
Default: - undefined
@Stability(value=Experimental) @Nullable default List<String> getForceCoverageMatch()
With this option, you can overwrite this behavior and include otherwise ignored files in code coverage.
Default: - ['']
@Stability(value=Experimental) @Nullable default Object getGlobals()
Default: - {}
@Stability(value=Experimental) @Nullable default String getGlobalSetup()
This function gets Jest's globalConfig object as a parameter.
Default: - undefined
@Stability(value=Experimental) @Nullable default String getGlobalTeardown()
This function gets Jest's globalConfig object as a parameter.
Default: - undefined
@Stability(value=Experimental) @Nullable default HasteConfig getHaste()
Default: - {}
@Stability(value=Experimental) @Nullable default Boolean getInjectGlobals()
Default: - true
@Stability(value=Experimental) @Nullable default Number getMaxConcurrency()
Default: - 5
@Stability(value=Experimental) @Nullable default List<String> getModuleDirectories()
Setting this option will override the default, if you wish to still search node_modules for packages include it along with any other options: ["node_modules", "bower_components"]
Default: - ["node_modules"]
@Stability(value=Experimental) @Nullable default List<String> getModuleFileExtensions()
If you require modules without specifying a file extension, these are the extensions Jest will look for, in left-to-right order.
Default: - ["js", "json", "jsx", "ts", "tsx", "node"]
@Stability(value=Experimental) @Nullable default Map<String,Object> getModuleNameMapper()
Default: - null
@Stability(value=Experimental) @Nullable default List<String> getModulePathIgnorePatterns()
If a given module's path matches any of the patterns, it will not be require()-able in the test environment.
Default: - []
@Stability(value=Experimental) @Nullable default List<String> getModulePaths()
Use the
Default: - []
@Stability(value=Experimental) @Nullable default Boolean getNotify()
Default: - false
@Stability(value=Experimental) @Nullable default String getNotifyMode()
Requires notify: true
Default: - failure-change
@Stability(value=Experimental) @Nullable default String getPreset()
A preset should point to an npm module that has a jest-preset.json or jest-preset.js file at the root.
Default: - undefined
@Stability(value=Experimental) @Nullable default String getPrettierPath()
Default: - "prettier"
@Stability(value=Experimental) @Nullable default List<Object> getProjects()
This is great for monorepos or when working on multiple projects at the same time.
Default: - undefined
@Stability(value=Experimental) @Nullable default List<Object> getReporters()
A custom reporter is a class that implements onRunStart, onTestStart, onTestResult, onRunComplete methods that will be called when any of those events occurs.
Default: - undefined
@Stability(value=Experimental) @Nullable default Boolean getResetMocks()
Equivalent to calling jest.resetAllMocks() before each test. This will lead to any mocks having their fake implementations removed but does not restore their initial implementation.
Default: - false
@Stability(value=Experimental) @Nullable default Boolean getResetModules()
Enabling resetModules goes a step further and resets the module registry before running each individual test.
Default: - false
@Stability(value=Experimental) @Nullable default String getResolver()
https://jestjs.io/docs/en/configuration#resolver-string
Default: - undefined
@Stability(value=Experimental) @Nullable default Boolean getRestoreMocks()
Equivalent to calling jest.restoreAllMocks() before each test. This will lead to any mocks having their fake implementations removed and restores their initial implementation.
Default: - false
@Stability(value=Experimental) @Nullable default String getRootDir()
If you put your Jest config inside your package.json and want the root directory to be the root of your repo, the value for this config param will default to the directory of the package.json.
Default: - directory of the package.json
@Stability(value=Experimental) @Nullable default List<String> getRoots()
Default: - ["
@Stability(value=Experimental) @Nullable default String getRunner()
Default: - "jest-runner"
@Stability(value=Experimental) @Nullable default List<String> getSetupFiles()
Each setupFile will be run once per test file. Since every test runs in its own environment, these scripts will be executed in the testing environment immediately before executing the test code itself.
Default: - []
@Stability(value=Experimental) @Nullable default List<String> getSetupFilesAfterEnv()
Since setupFiles executes before the test framework is installed in the environment, this script file presents you the opportunity of running some code immediately after the test framework has been installed in the environment.
Default: - []
@Stability(value=Experimental) @Nullable default Number getSlowTestThreshold()
Default: - 5
@Stability(value=Experimental) @Nullable default String getSnapshotResolver()
This config option lets you customize where Jest stores snapshot files on disk.
Default: - undefined
@Stability(value=Experimental) @Nullable default List<String> getSnapshotSerializers()
Default: = []
@Stability(value=Experimental) @Nullable default String getTestEnvironment()
The default environment in Jest is a browser-like environment through jsdom. If you are building a node service, you can use the node option to use a node-like environment instead.
Default: - "jsdom"
@Stability(value=Experimental) @Nullable default Object getTestEnvironmentOptions()
The relevant options depend on the environment.
Default: - {}
@Stability(value=Experimental) @Nullable default Number getTestFailureExitCode()
Default: - 1
@Stability(value=Experimental) @Nullable default List<String> getTestMatch()
By default it looks for .js, .jsx, .ts and .tsx files inside of tests folders, as well as any files with a suffix of .test or .spec (e.g. Component.test.js or Component.spec.js). It will also find files called test.js or spec.js.
Default: ['**\/__tests__/**\/*.[jt]s?(x)', '**\/?(*.)+(spec|test).[tj]s?(x)']
@Stability(value=Experimental) @Nullable default List<String> getTestPathIgnorePatterns()
If the test path matches any of the patterns, it will be skipped.
Default: - ["/node_modules/"]
@Stability(value=Experimental) @Nullable default Object getTestRegex()
By default it looks for .js, .jsx, .ts and .tsx files inside of tests folders, as well as any files with a suffix of .test or .spec (e.g. Component.test.js or Component.spec.js). It will also find files called test.js or spec.js.
Default: - (/__tests__/.*|(\\.|/)(test|spec))\\.[jt]sx?$
@Stability(value=Experimental) @Nullable default String getTestResultsProcessor()
Default: - undefined
@Stability(value=Experimental) @Nullable default String getTestRunner()
The default is jasmine2. A custom test runner can be provided by specifying a path to a test runner implementation.
Default: - "jasmine2"
@Stability(value=Experimental) @Nullable default String getTestSequencer()
Sort may optionally return a Promise.
Default: - "
@Stability(value=Experimental) @Nullable default Number getTestTimeout()
Default: - 5000
@Stability(value=Experimental) @Nullable default String getTestURL()
It is reflected in properties such as location.href.
Default: - "http://localhost"
@Stability(value=Experimental) @Nullable default String getTimers()
Fake timers are useful when a piece of code sets a long timeout that we don't want to wait for in a test.
Default: - "real"
@Stability(value=Experimental) @Nullable default Map<String,Object> getTransform()
A transformer is a module that provides a synchronous function for transforming source files.
Default: - {"\\.[jt]sx?$": "babel-jest"}
@Stability(value=Experimental) @Nullable default List<String> getTransformIgnorePatterns()
If the test path matches any of the patterns, it will not be transformed.
Default: - ["/node_modules/", "\\.pnp\\.[^\\\/]+$"]
@Stability(value=Experimental) @Nullable default List<String> getUnmockedModulePathPatterns()
If a module's path matches any of the patterns in this list, it will not be automatically mocked by the module loader.
Default: - []
@Stability(value=Experimental) @Nullable default Boolean getVerbose()
All errors will also still be shown on the bottom after execution. Note that if there is only one test file being run it will default to true.
Default: - false
@Stability(value=Experimental) @Nullable default Boolean getWatchman()
Default: - true
@Stability(value=Experimental) @Nullable default List<String> getWatchPathIgnorePatterns()
If the file path matches any of the patterns, when it is updated, it will not trigger a re-run of tests.
Default: - []
@Stability(value=Experimental) @Nullable default com.fasterxml.jackson.databind.node.ObjectNode getWatchPlugins()
@Stability(value=Experimental) static JestConfigOptions.Builder builder()
JestConfigOptions.Builder of JestConfigOptionsCopyright © 2021. All rights reserved.