From cb5bd44c14083a9b632273db1e03f0d60039f789 Mon Sep 17 00:00:00 2001 From: Ayush Sachdeva Date: Sun, 17 Nov 2019 10:32:31 +0530 Subject: [PATCH] Escape angle brackets in configuration page of versioned docs --- .../version-22.x/Configuration.md | 38 +++++++-------- .../version-23.x/Configuration.md | 40 ++++++++-------- .../version-24.0/Configuration.md | 46 +++++++++---------- .../version-24.1/Configuration.md | 46 +++++++++---------- .../version-24.6/Configuration.md | 46 +++++++++---------- .../version-24.8/Configuration.md | 46 +++++++++---------- .../version-24.9/Configuration.md | 46 +++++++++---------- 7 files changed, 154 insertions(+), 154 deletions(-) diff --git a/website/versioned_docs/version-22.x/Configuration.md b/website/versioned_docs/version-22.x/Configuration.md index 1569530e4b3e..9e1213b21ece 100644 --- a/website/versioned_docs/version-22.x/Configuration.md +++ b/website/versioned_docs/version-22.x/Configuration.md @@ -140,7 +140,7 @@ Default: `undefined` The directory where Jest should output its coverage files. -### `coveragePathIgnorePatterns` [array] +### `coveragePathIgnorePatterns` [array\] Default: `["/node_modules/"]` @@ -148,7 +148,7 @@ An array of regexp pattern strings that are matched against all file paths befor These pattern strings match against the full path. Use the `` string token to include the path to your project's root directory to prevent it from accidentally ignoring all of your files in different environments that may have different root directories. Example: `["/build/", "/node_modules/"]`. -### `coverageReporters` [array] +### `coverageReporters` [array\] Default: `["json", "lcov", "text", "clover"]` @@ -226,7 +226,7 @@ default: `undefined` Allows for a label to be printed along side a test while it is running. This becomes more useful in multiproject repositories where there can be many jest configuration files. This visually tells which project a test belongs to. -### `forceCoverageMatch` [array] +### `forceCoverageMatch` [array\] Default: `['']` @@ -292,7 +292,7 @@ Default: `undefined` This option allows the use of a custom global teardown module which exports an async function that is triggered once after all test suites. -### `moduleFileExtensions` [array] +### `moduleFileExtensions` [array\] Default: `["js", "json", "jsx", "node"]` @@ -300,13 +300,13 @@ An array of file extensions your modules use. If you require modules without spe If you are using TypeScript, you will want to add `"ts"` and/or `"tsx"` to the above default. Where you place these is up to you - we recommend placing the extensions most commonly used in your project on the left. -### `moduleDirectories` [array] +### `moduleDirectories` [array\] Default: `["node_modules"]` An array of directory names to be searched recursively up from the requiring module's location. 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"]` -### `moduleNameMapper` [object] +### `moduleNameMapper` [object\] Default: `null` @@ -334,7 +334,7 @@ The order in which the mappings are defined matters. Patterns are checked one by _Note: If you provide module name without boundaries `^$` it may cause hard to spot errors. E.g. `relay` will replace all modules which contain `relay` as a substring in its name: `relay`, `react-relay` and `graphql-relay` will all be pointed to your stub._ -### `modulePathIgnorePatterns` [array] +### `modulePathIgnorePatterns` [array\] Default: `[]` @@ -342,7 +342,7 @@ An array of regexp pattern strings that are matched against all module paths bef These pattern strings match against the full path. Use the `` string token to include the path to your project's root directory to prevent it from accidentally ignoring all of your files in different environments that may have different root directories. Example: `["/build/"]`. -### `modulePaths` [array] +### `modulePaths` [array\] Default: `[]` @@ -375,7 +375,7 @@ Default: `undefined` A preset that is used as a base for Jest's configuration. A preset should point to an npm module that exports a `jest-preset.json` module on its top level. -### `projects` [array] +### `projects` [array\] Default: `undefined` @@ -414,7 +414,7 @@ Default: `false` Automatically clear mock calls and instances between every test. Equivalent to calling `jest.clearAllMocks()` between each test. This does not remove any mock implementation that may have been provided. -### `reporters` [array] +### `reporters` [array\] Default: `undefined` @@ -533,7 +533,7 @@ Oftentimes, you'll want to set this to `'src'` or `'lib'`, corresponding to wher _Note that using `''` as a string token in any other path-based config settings will refer back to this value. So, for example, if you want your [`setupFiles`](#setupfiles-array) config entry to point at the `env-setup.js` file at the root of your project, you could set its value to `["/env-setup.js"]`._ -### `roots` [array] +### `roots` [array\] Default: `[""]` @@ -585,7 +585,7 @@ The path to a module that runs some code to configure or set up the testing fram For example, Jest ships with several plug-ins to `jasmine` that work by monkey-patching the jasmine API. If you wanted to add even more jasmine plugins to the mix (or if you wanted some custom, project-wide matchers for example), you could do so in this module. -### `snapshotSerializers` [array] +### `snapshotSerializers` [array\] Default: `[]` @@ -716,7 +716,7 @@ Default: `{}` Test environment options that will be passed to the `testEnvironment`. The relevant options depend on the environment. For example you can override options given to [jsdom](https://github.com/tmpvar/jsdom) such as `{userAgent: "Agent/007"}`. -### `testMatch` [array] +### `testMatch` [array\] (default: `[ '**/__tests__/**/*.js?(x)', '**/?(*.)(spec|test).js?(x)' ]`) @@ -726,7 +726,7 @@ See the [micromatch](https://github.com/jonschlinkert/micromatch) package for de See also [`testRegex` [string]](#testregex-string), but note that you cannot specify both options. -### `testPathIgnorePatterns` [array] +### `testPathIgnorePatterns` [array\] Default: `["/node_modules/"]` @@ -738,7 +738,7 @@ These pattern strings match against the full path. Use the `` string to Default: `(/__tests__/.*|(\\.|/)(test|spec))\\.jsx?$` -The pattern Jest uses to detect test files. By default it looks for `.js` and `.jsx` 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`. See also [`testMatch` [array]](#testmatch-array-string), but note that you cannot specify both options. +The pattern Jest uses to detect test files. By default it looks for `.js` and `.jsx` 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`. See also [`testMatch` [array\]](#testmatch-array-string), but note that you cannot specify both options. The following is a visualization of the default regex: @@ -830,7 +830,7 @@ Default: `real` Setting this value to `fake` allows the use of fake timers for functions such as `setTimeout`. Fake timers are useful when a piece of code sets a long timeout that we don't want to wait for in a test. -### `transform` [object] +### `transform` [object\] Default: `undefined` @@ -842,7 +842,7 @@ _Note: a transformer is only run once per file unless the file has changed. Duri _Note: if you are using the `babel-jest` transformer and want to use an additional code preprocessor, keep in mind that when "transform" is overwritten in any way the `babel-jest` is not loaded automatically anymore. If you want to use it to compile JavaScript code it has to be explicitly defined. See [babel-jest plugin](https://github.com/facebook/jest/tree/master/packages/babel-jest#setup)_ -### `transformIgnorePatterns` [array] +### `transformIgnorePatterns` [array\] Default: `["/node_modules/"]` @@ -854,7 +854,7 @@ Example: `["/bower_components/", "/node_modules/"]`. Sometimes it happens (especially in React Native or TypeScript projects) that 3rd party modules are published as untranspiled. Since all files inside `node_modules` are not transformed by default, Jest will not understand the code in these modules, resulting in syntax errors. To overcome this, you may use `transformIgnorePatterns` to whitelist such modules. You'll find a good example of this use case in [React Native Guide](https://jestjs.io/docs/en/tutorial-react-native.html#transformignorepatterns-customization). -### `unmockedModulePathPatterns` [array] +### `unmockedModulePathPatterns` [array\] Default: `[]` @@ -870,7 +870,7 @@ Default: `false` Indicates whether each individual test should be reported during the run. All errors will also still be shown on the bottom after execution. -### `watchPathIgnorePatterns` [array] +### `watchPathIgnorePatterns` [array\] Default: `[]` diff --git a/website/versioned_docs/version-23.x/Configuration.md b/website/versioned_docs/version-23.x/Configuration.md index 949aab59e96f..67570a318dbc 100644 --- a/website/versioned_docs/version-23.x/Configuration.md +++ b/website/versioned_docs/version-23.x/Configuration.md @@ -178,7 +178,7 @@ Default: `undefined` The directory where Jest should output its coverage files. -### `coveragePathIgnorePatterns` [array] +### `coveragePathIgnorePatterns` [array\] Default: `["/node_modules/"]` @@ -186,7 +186,7 @@ An array of regexp pattern strings that are matched against all file paths befor These pattern strings match against the full path. Use the `` string token to include the path to your project's root directory to prevent it from accidentally ignoring all of your files in different environments that may have different root directories. Example: `["/build/", "/node_modules/"]`. -### `coverageReporters` [array] +### `coverageReporters` [array\] Default: `["json", "lcov", "text", "clover"]` @@ -270,7 +270,7 @@ Default: `false` Make calling deprecated APIs throw helpful error messages. Useful for easing the upgrade process. -### `forceCoverageMatch` [array] +### `forceCoverageMatch` [array\] Default: `['']` @@ -336,13 +336,13 @@ Default: `undefined` This option allows the use of a custom global teardown module which exports an async function that is triggered once after all test suites. This function gets Jest's `globalConfig` object as a parameter. -### `moduleDirectories` [array] +### `moduleDirectories` [array\] Default: `["node_modules"]` An array of directory names to be searched recursively up from the requiring module's location. 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"]` -### `moduleFileExtensions` [array] +### `moduleFileExtensions` [array\] Default: `["js", "json", "jsx", "node"]` @@ -350,7 +350,7 @@ An array of file extensions your modules use. If you require modules without spe If you are using TypeScript, you will want to add `"ts"` and/or `"tsx"` to the above default. Where you place these is up to you - we recommend placing the extensions most commonly used in your project on the left. -### `moduleNameMapper` [object] +### `moduleNameMapper` [object\] Default: `null` @@ -378,7 +378,7 @@ The order in which the mappings are defined matters. Patterns are checked one by _Note: If you provide module name without boundaries `^$` it may cause hard to spot errors. E.g. `relay` will replace all modules which contain `relay` as a substring in its name: `relay`, `react-relay` and `graphql-relay` will all be pointed to your stub._ -### `modulePathIgnorePatterns` [array] +### `modulePathIgnorePatterns` [array\] Default: `[]` @@ -386,7 +386,7 @@ An array of regexp pattern strings that are matched against all module paths bef These pattern strings match against the full path. Use the `` string token to include the path to your project's root directory to prevent it from accidentally ignoring all of your files in different environments that may have different root directories. Example: `["/build/"]`. -### `modulePaths` [array] +### `modulePaths` [array\] Default: `[]` @@ -441,7 +441,7 @@ Default: `'prettier'` Sets the path to the [`prettier`](https://prettier.io/) node module used to update inline snapshots. -### `projects` [array] +### `projects` [array\] Default: `undefined` @@ -474,7 +474,7 @@ The projects feature can also be used to run multiple configurations or multiple _Note: When using multi project runner, it's recommended to add a `displayName` for each project. This will show the `displayName` of a project next to its tests._ -### `reporters` [array] +### `reporters` [array\] Default: `undefined` @@ -593,7 +593,7 @@ Oftentimes, you'll want to set this to `'src'` or `'lib'`, corresponding to wher _Note that using `''` as a string token in any other path-based config settings will refer back to this value. So, for example, if you want your [`setupFiles`](#setupfiles-array) config entry to point at the `env-setup.js` file at the root of your project, you could set its value to `["/env-setup.js"]`._ -### `roots` [array] +### `roots` [array\] Default: `[""]` @@ -649,7 +649,7 @@ If you want this path to be [relative to the root directory of your project](#ro For example, Jest ships with several plug-ins to `jasmine` that work by monkey-patching the jasmine API. If you wanted to add even more jasmine plugins to the mix (or if you wanted some custom, project-wide matchers for example), you could do so in this module. -### `snapshotSerializers` [array] +### `snapshotSerializers` [array\] Default: `[]` @@ -782,7 +782,7 @@ Default: `{}` Test environment options that will be passed to the `testEnvironment`. The relevant options depend on the environment. For example you can override options given to [jsdom](https://github.com/tmpvar/jsdom) such as `{userAgent: "Agent/007"}`. -### `testMatch` [array] +### `testMatch` [array\] (default: `[ "**/__tests__/**/*.js?(x)", "**/?(*.)+(spec|test).js?(x)" ]`) @@ -792,7 +792,7 @@ See the [micromatch](https://github.com/jonschlinkert/micromatch) package for de See also [`testRegex` [string]](#testregex-string), but note that you cannot specify both options. -### `testPathIgnorePatterns` [array] +### `testPathIgnorePatterns` [array\] Default: `["/node_modules/"]` @@ -804,7 +804,7 @@ These pattern strings match against the full path. Use the `` string to Default: `(/__tests__/.*|(\\.|/)(test|spec))\\.jsx?$` -The pattern Jest uses to detect test files. By default it looks for `.js` and `.jsx` 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`. See also [`testMatch` [array]](#testmatch-array-string), but note that you cannot specify both options. +The pattern Jest uses to detect test files. By default it looks for `.js` and `.jsx` 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`. See also [`testMatch` [array\]](#testmatch-array-string), but note that you cannot specify both options. The following is a visualization of the default regex: @@ -899,7 +899,7 @@ Default: `real` Setting this value to `fake` allows the use of fake timers for functions such as `setTimeout`. Fake timers are useful when a piece of code sets a long timeout that we don't want to wait for in a test. -### `transform` [object] +### `transform` [object\] Default: `undefined` @@ -911,7 +911,7 @@ _Note: a transformer is only run once per file unless the file has changed. Duri _Note: if you are using the `babel-jest` transformer and want to use an additional code preprocessor, keep in mind that when "transform" is overwritten in any way the `babel-jest` is not loaded automatically anymore. If you want to use it to compile JavaScript code it has to be explicitly defined. See [babel-jest plugin](https://github.com/facebook/jest/tree/master/packages/babel-jest#setup)_ -### `transformIgnorePatterns` [array] +### `transformIgnorePatterns` [array\] Default: `["/node_modules/"]` @@ -923,7 +923,7 @@ Example: `["/bower_components/", "/node_modules/"]`. Sometimes it happens (especially in React Native or TypeScript projects) that 3rd party modules are published as untranspiled. Since all files inside `node_modules` are not transformed by default, Jest will not understand the code in these modules, resulting in syntax errors. To overcome this, you may use `transformIgnorePatterns` to whitelist such modules. You'll find a good example of this use case in [React Native Guide](https://jestjs.io/docs/en/tutorial-react-native#transformignorepatterns-customization). -### `unmockedModulePathPatterns` [array] +### `unmockedModulePathPatterns` [array\] Default: `[]` @@ -939,7 +939,7 @@ Default: `false` Indicates whether each individual test should be reported during the run. All errors will also still be shown on the bottom after execution. -### `watchPathIgnorePatterns` [array] +### `watchPathIgnorePatterns` [array\] Default: `[]` @@ -947,7 +947,7 @@ An array of RegExp patterns that are matched against all source file paths befor These patterns match against the full path. Use the `` string token to include the path to your project's root directory to prevent it from accidentally ignoring all of your files in different environments that may have different root directories. Example: `["/node_modules/"]`. -### `watchPlugins` [array] +### `watchPlugins` [array\] Default: `[]` diff --git a/website/versioned_docs/version-24.0/Configuration.md b/website/versioned_docs/version-24.0/Configuration.md index 87f1f33b286c..1754599b69db 100644 --- a/website/versioned_docs/version-24.0/Configuration.md +++ b/website/versioned_docs/version-24.0/Configuration.md @@ -178,7 +178,7 @@ Default: `undefined` The directory where Jest should output its coverage files. -### `coveragePathIgnorePatterns` [array] +### `coveragePathIgnorePatterns` [array\] Default: `["/node_modules/"]` @@ -186,7 +186,7 @@ An array of regexp pattern strings that are matched against all file paths befor These pattern strings match against the full path. Use the `` string token to include the path to your project's root directory to prevent it from accidentally ignoring all of your files in different environments that may have different root directories. Example: `["/build/", "/node_modules/"]`. -### `coverageReporters` [array] +### `coverageReporters` [array\] Default: `["json", "lcov", "text", "clover"]` @@ -299,7 +299,7 @@ Default: `false` Make calling deprecated APIs throw helpful error messages. Useful for easing the upgrade process. -### `extraGlobals` [array] +### `extraGlobals` [array\] Default: `undefined` @@ -316,7 +316,7 @@ For example, if your tests call `Math` often, you can pass it by setting `extraG } ``` -### `forceCoverageMatch` [array] +### `forceCoverageMatch` [array\] Default: `['']` @@ -410,13 +410,13 @@ _Note: A global teardown module configured in a project (using multi-project run _Note: The same caveat concerning transformation of `node_modules` as for `globalSetup` applies to `globalTeardown`._ -### `moduleDirectories` [array] +### `moduleDirectories` [array\] Default: `["node_modules"]` An array of directory names to be searched recursively up from the requiring module's location. 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"]` -### `moduleFileExtensions` [array] +### `moduleFileExtensions` [array\] Default: `["js", "json", "jsx", "ts", "tsx", "node"]` @@ -424,7 +424,7 @@ An array of file extensions your modules use. If you require modules without spe We recommend placing the extensions most commonly used in your project on the left, so if you are using TypeScript, you may want to consider moving "ts" and/or "tsx" to the beginning of the array. -### `moduleNameMapper` [object] +### `moduleNameMapper` [object\] Default: `null` @@ -452,7 +452,7 @@ The order in which the mappings are defined matters. Patterns are checked one by _Note: If you provide module name without boundaries `^$` it may cause hard to spot errors. E.g. `relay` will replace all modules which contain `relay` as a substring in its name: `relay`, `react-relay` and `graphql-relay` will all be pointed to your stub._ -### `modulePathIgnorePatterns` [array] +### `modulePathIgnorePatterns` [array\] Default: `[]` @@ -460,7 +460,7 @@ An array of regexp pattern strings that are matched against all module paths bef These pattern strings match against the full path. Use the `` string token to include the path to your project's root directory to prevent it from accidentally ignoring all of your files in different environments that may have different root directories. Example: `["/build/"]`. -### `modulePaths` [array] +### `modulePaths` [array\] Default: `[]` @@ -515,7 +515,7 @@ Default: `'prettier'` Sets the path to the [`prettier`](https://prettier.io/) node module used to update inline snapshots. -### `projects` [array] +### `projects` [array\] Default: `undefined` @@ -548,7 +548,7 @@ The projects feature can also be used to run multiple configurations or multiple _Note: When using multi project runner, it's recommended to add a `displayName` for each project. This will show the `displayName` of a project next to its tests._ -### `reporters` [array] +### `reporters` [array\] Default: `undefined` @@ -667,7 +667,7 @@ Oftentimes, you'll want to set this to `'src'` or `'lib'`, corresponding to wher _Note that using `''` as a string token in any other path-based config settings will refer back to this value. So, for example, if you want your [`setupFiles`](#setupfiles-array) config entry to point at the `env-setup.js` file at the root of your project, you could set its value to `["/env-setup.js"]`._ -### `roots` [array] +### `roots` [array\] Default: `[""]` @@ -766,7 +766,7 @@ module.exports = { }; ``` -### `snapshotSerializers` [array] +### `snapshotSerializers` [array\] Default: `[]` @@ -900,7 +900,7 @@ Default: `{}` Test environment options that will be passed to the `testEnvironment`. The relevant options depend on the environment. For example you can override options given to [jsdom](https://github.com/tmpvar/jsdom) such as `{userAgent: "Agent/007"}`. -### `testMatch` [array] +### `testMatch` [array\] (default: `[ "**/__tests__/**/*.[jt]s?(x)", "**/?(*.)+(spec|test).[jt]s?(x)" ]`) @@ -908,9 +908,9 @@ The glob patterns Jest uses to detect test files. By default it looks for `.js`, See the [micromatch](https://github.com/jonschlinkert/micromatch) package for details of the patterns you can specify. -See also [`testRegex` [string | array]](#testregex-string-array-string), but note that you cannot specify both options. +See also [`testRegex` [string | array\]](#testregex-string-array-string), but note that you cannot specify both options. -### `testPathIgnorePatterns` [array] +### `testPathIgnorePatterns` [array\] Default: `["/node_modules/"]` @@ -918,11 +918,11 @@ An array of regexp pattern strings that are matched against all test paths befor These pattern strings match against the full path. Use the `` string token to include the path to your project's root directory to prevent it from accidentally ignoring all of your files in different environments that may have different root directories. Example: `["/build/", "/node_modules/"]`. -### `testRegex` [string | array] +### `testRegex` [string | array\] Default: `(/__tests__/.*|(\\.|/)(test|spec))\\.[jt]sx?$` -The pattern or patterns Jest uses to detect test files. 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`. See also [`testMatch` [array]](#testmatch-array-string), but note that you cannot specify both options. +The pattern or patterns Jest uses to detect test files. 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`. See also [`testMatch` [array\]](#testmatch-array-string), but note that you cannot specify both options. The following is a visualization of the default regex: @@ -1018,7 +1018,7 @@ Default: `real` Setting this value to `fake` allows the use of fake timers for functions such as `setTimeout`. Fake timers are useful when a piece of code sets a long timeout that we don't want to wait for in a test. -### `transform` [object] +### `transform` [object\] Default: `undefined` @@ -1030,7 +1030,7 @@ _Note: a transformer is only run once per file unless the file has changed. Duri _Note: if you are using the `babel-jest` transformer and want to use an additional code preprocessor, keep in mind that when "transform" is overwritten in any way the `babel-jest` is not loaded automatically anymore. If you want to use it to compile JavaScript code it has to be explicitly defined. See [babel-jest plugin](https://github.com/facebook/jest/tree/master/packages/babel-jest#setup)_ -### `transformIgnorePatterns` [array] +### `transformIgnorePatterns` [array\] Default: `["/node_modules/"]` @@ -1042,7 +1042,7 @@ Example: `["/bower_components/", "/node_modules/"]`. Sometimes it happens (especially in React Native or TypeScript projects) that 3rd party modules are published as untranspiled. Since all files inside `node_modules` are not transformed by default, Jest will not understand the code in these modules, resulting in syntax errors. To overcome this, you may use `transformIgnorePatterns` to whitelist such modules. You'll find a good example of this use case in [React Native Guide](https://jestjs.io/docs/en/tutorial-react-native#transformignorepatterns-customization). -### `unmockedModulePathPatterns` [array] +### `unmockedModulePathPatterns` [array\] Default: `[]` @@ -1058,7 +1058,7 @@ Default: `false` Indicates whether each individual test should be reported during the run. All errors will also still be shown on the bottom after execution. -### `watchPathIgnorePatterns` [array] +### `watchPathIgnorePatterns` [array\] Default: `[]` @@ -1066,7 +1066,7 @@ An array of RegExp patterns that are matched against all source file paths befor These patterns match against the full path. Use the `` string token to include the path to your project's root directory to prevent it from accidentally ignoring all of your files in different environments that may have different root directories. Example: `["/node_modules/"]`. -### `watchPlugins` [array] +### `watchPlugins` [array\] Default: `[]` diff --git a/website/versioned_docs/version-24.1/Configuration.md b/website/versioned_docs/version-24.1/Configuration.md index dfed5943ac3d..e5ff2e77c03a 100644 --- a/website/versioned_docs/version-24.1/Configuration.md +++ b/website/versioned_docs/version-24.1/Configuration.md @@ -178,7 +178,7 @@ Default: `undefined` The directory where Jest should output its coverage files. -### `coveragePathIgnorePatterns` [array] +### `coveragePathIgnorePatterns` [array\] Default: `["/node_modules/"]` @@ -186,7 +186,7 @@ An array of regexp pattern strings that are matched against all file paths befor These pattern strings match against the full path. Use the `` string token to include the path to your project's root directory to prevent it from accidentally ignoring all of your files in different environments that may have different root directories. Example: `["/build/", "/node_modules/"]`. -### `coverageReporters` [array] +### `coverageReporters` [array\] Default: `["json", "lcov", "text", "clover"]` @@ -299,7 +299,7 @@ Default: `false` Make calling deprecated APIs throw helpful error messages. Useful for easing the upgrade process. -### `extraGlobals` [array] +### `extraGlobals` [array\] Default: `undefined` @@ -316,7 +316,7 @@ For example, if your tests call `Math` often, you can pass it by setting `extraG } ``` -### `forceCoverageMatch` [array] +### `forceCoverageMatch` [array\] Default: `['']` @@ -416,13 +416,13 @@ Default: `5` A number limiting the number of tests that are allowed to run at the same time when using `test.concurrent`. Any test above this limit will be queued and executed once a slot is released. -### `moduleDirectories` [array] +### `moduleDirectories` [array\] Default: `["node_modules"]` An array of directory names to be searched recursively up from the requiring module's location. 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"]` -### `moduleFileExtensions` [array] +### `moduleFileExtensions` [array\] Default: `["js", "json", "jsx", "ts", "tsx", "node"]` @@ -430,7 +430,7 @@ An array of file extensions your modules use. If you require modules without spe We recommend placing the extensions most commonly used in your project on the left, so if you are using TypeScript, you may want to consider moving "ts" and/or "tsx" to the beginning of the array. -### `moduleNameMapper` [object] +### `moduleNameMapper` [object\] Default: `null` @@ -458,7 +458,7 @@ The order in which the mappings are defined matters. Patterns are checked one by _Note: If you provide module name without boundaries `^$` it may cause hard to spot errors. E.g. `relay` will replace all modules which contain `relay` as a substring in its name: `relay`, `react-relay` and `graphql-relay` will all be pointed to your stub._ -### `modulePathIgnorePatterns` [array] +### `modulePathIgnorePatterns` [array\] Default: `[]` @@ -466,7 +466,7 @@ An array of regexp pattern strings that are matched against all module paths bef These pattern strings match against the full path. Use the `` string token to include the path to your project's root directory to prevent it from accidentally ignoring all of your files in different environments that may have different root directories. Example: `["/build/"]`. -### `modulePaths` [array] +### `modulePaths` [array\] Default: `[]` @@ -521,7 +521,7 @@ Default: `'prettier'` Sets the path to the [`prettier`](https://prettier.io/) node module used to update inline snapshots. -### `projects` [array] +### `projects` [array\] Default: `undefined` @@ -554,7 +554,7 @@ The projects feature can also be used to run multiple configurations or multiple _Note: When using multi project runner, it's recommended to add a `displayName` for each project. This will show the `displayName` of a project next to its tests._ -### `reporters` [array] +### `reporters` [array\] Default: `undefined` @@ -676,7 +676,7 @@ Oftentimes, you'll want to set this to `'src'` or `'lib'`, corresponding to wher _Note that using `''` as a string token in any other path-based config settings will refer back to this value. So, for example, if you want your [`setupFiles`](#setupfiles-array) config entry to point at the `env-setup.js` file at the root of your project, you could set its value to `["/env-setup.js"]`._ -### `roots` [array] +### `roots` [array\] Default: `[""]` @@ -775,7 +775,7 @@ module.exports = { }; ``` -### `snapshotSerializers` [array] +### `snapshotSerializers` [array\] Default: `[]` @@ -909,7 +909,7 @@ Default: `{}` Test environment options that will be passed to the `testEnvironment`. The relevant options depend on the environment. For example you can override options given to [jsdom](https://github.com/tmpvar/jsdom) such as `{userAgent: "Agent/007"}`. -### `testMatch` [array] +### `testMatch` [array\] (default: `[ "**/__tests__/**/*.[jt]s?(x)", "**/?(*.)+(spec|test).[jt]s?(x)" ]`) @@ -917,9 +917,9 @@ The glob patterns Jest uses to detect test files. By default it looks for `.js`, See the [micromatch](https://github.com/jonschlinkert/micromatch) package for details of the patterns you can specify. -See also [`testRegex` [string | array]](#testregex-string-array-string), but note that you cannot specify both options. +See also [`testRegex` [string | array\]](#testregex-string-array-string), but note that you cannot specify both options. -### `testPathIgnorePatterns` [array] +### `testPathIgnorePatterns` [array\] Default: `["/node_modules/"]` @@ -927,11 +927,11 @@ An array of regexp pattern strings that are matched against all test paths befor These pattern strings match against the full path. Use the `` string token to include the path to your project's root directory to prevent it from accidentally ignoring all of your files in different environments that may have different root directories. Example: `["/build/", "/node_modules/"]`. -### `testRegex` [string | array] +### `testRegex` [string | array\] Default: `(/__tests__/.*|(\\.|/)(test|spec))\\.[jt]sx?$` -The pattern or patterns Jest uses to detect test files. 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`. See also [`testMatch` [array]](#testmatch-array-string), but note that you cannot specify both options. +The pattern or patterns Jest uses to detect test files. 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`. See also [`testMatch` [array\]](#testmatch-array-string), but note that you cannot specify both options. The following is a visualization of the default regex: @@ -1027,7 +1027,7 @@ Default: `real` Setting this value to `fake` allows the use of fake timers for functions such as `setTimeout`. Fake timers are useful when a piece of code sets a long timeout that we don't want to wait for in a test. -### `transform` [object] +### `transform` [object\] Default: `undefined` @@ -1039,7 +1039,7 @@ _Note: a transformer is only run once per file unless the file has changed. Duri _Note: if you are using the `babel-jest` transformer and want to use an additional code preprocessor, keep in mind that when "transform" is overwritten in any way the `babel-jest` is not loaded automatically anymore. If you want to use it to compile JavaScript code it has to be explicitly defined. See [babel-jest plugin](https://github.com/facebook/jest/tree/master/packages/babel-jest#setup)_ -### `transformIgnorePatterns` [array] +### `transformIgnorePatterns` [array\] Default: `["/node_modules/"]` @@ -1051,7 +1051,7 @@ Example: `["/bower_components/", "/node_modules/"]`. Sometimes it happens (especially in React Native or TypeScript projects) that 3rd party modules are published as untranspiled. Since all files inside `node_modules` are not transformed by default, Jest will not understand the code in these modules, resulting in syntax errors. To overcome this, you may use `transformIgnorePatterns` to whitelist such modules. You'll find a good example of this use case in [React Native Guide](https://jestjs.io/docs/en/tutorial-react-native#transformignorepatterns-customization). -### `unmockedModulePathPatterns` [array] +### `unmockedModulePathPatterns` [array\] Default: `[]` @@ -1067,7 +1067,7 @@ Default: `false` Indicates whether each individual test should be reported during the run. All errors will also still be shown on the bottom after execution. -### `watchPathIgnorePatterns` [array] +### `watchPathIgnorePatterns` [array\] Default: `[]` @@ -1075,7 +1075,7 @@ An array of RegExp patterns that are matched against all source file paths befor These patterns match against the full path. Use the `` string token to include the path to your project's root directory to prevent it from accidentally ignoring all of your files in different environments that may have different root directories. Example: `["/node_modules/"]`. -### `watchPlugins` [array] +### `watchPlugins` [array\] Default: `[]` diff --git a/website/versioned_docs/version-24.6/Configuration.md b/website/versioned_docs/version-24.6/Configuration.md index bfad9f7500ea..4b7d3c32140c 100644 --- a/website/versioned_docs/version-24.6/Configuration.md +++ b/website/versioned_docs/version-24.6/Configuration.md @@ -178,7 +178,7 @@ Default: `undefined` The directory where Jest should output its coverage files. -### `coveragePathIgnorePatterns` [array] +### `coveragePathIgnorePatterns` [array\] Default: `["/node_modules/"]` @@ -186,7 +186,7 @@ An array of regexp pattern strings that are matched against all file paths befor These pattern strings match against the full path. Use the `` string token to include the path to your project's root directory to prevent it from accidentally ignoring all of your files in different environments that may have different root directories. Example: `["/build/", "/node_modules/"]`. -### `coverageReporters` [array] +### `coverageReporters` [array\] Default: `["json", "lcov", "text", "clover"]` @@ -318,7 +318,7 @@ Default: `false` Make calling deprecated APIs throw helpful error messages. Useful for easing the upgrade process. -### `extraGlobals` [array] +### `extraGlobals` [array\] Default: `undefined` @@ -335,7 +335,7 @@ For example, if your tests call `Math` often, you can pass it by setting `extraG } ``` -### `forceCoverageMatch` [array] +### `forceCoverageMatch` [array\] Default: `['']` @@ -435,13 +435,13 @@ Default: `5` A number limiting the number of tests that are allowed to run at the same time when using `test.concurrent`. Any test above this limit will be queued and executed once a slot is released. -### `moduleDirectories` [array] +### `moduleDirectories` [array\] Default: `["node_modules"]` An array of directory names to be searched recursively up from the requiring module's location. 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"]` -### `moduleFileExtensions` [array] +### `moduleFileExtensions` [array\] Default: `["js", "json", "jsx", "ts", "tsx", "node"]` @@ -449,7 +449,7 @@ An array of file extensions your modules use. If you require modules without spe We recommend placing the extensions most commonly used in your project on the left, so if you are using TypeScript, you may want to consider moving "ts" and/or "tsx" to the beginning of the array. -### `moduleNameMapper` [object] +### `moduleNameMapper` [object\] Default: `null` @@ -477,7 +477,7 @@ The order in which the mappings are defined matters. Patterns are checked one by _Note: If you provide module name without boundaries `^$` it may cause hard to spot errors. E.g. `relay` will replace all modules which contain `relay` as a substring in its name: `relay`, `react-relay` and `graphql-relay` will all be pointed to your stub._ -### `modulePathIgnorePatterns` [array] +### `modulePathIgnorePatterns` [array\] Default: `[]` @@ -485,7 +485,7 @@ An array of regexp pattern strings that are matched against all module paths bef These pattern strings match against the full path. Use the `` string token to include the path to your project's root directory to prevent it from accidentally ignoring all of your files in different environments that may have different root directories. Example: `["/build/"]`. -### `modulePaths` [array] +### `modulePaths` [array\] Default: `[]` @@ -540,7 +540,7 @@ Default: `'prettier'` Sets the path to the [`prettier`](https://prettier.io/) node module used to update inline snapshots. -### `projects` [array] +### `projects` [array\] Default: `undefined` @@ -573,7 +573,7 @@ The projects feature can also be used to run multiple configurations or multiple _Note: When using multi project runner, it's recommended to add a `displayName` for each project. This will show the `displayName` of a project next to its tests._ -### `reporters` [array] +### `reporters` [array\] Default: `undefined` @@ -695,7 +695,7 @@ Oftentimes, you'll want to set this to `'src'` or `'lib'`, corresponding to wher _Note that using `''` as a string token in any other path-based config settings will refer back to this value. So, for example, if you want your [`setupFiles`](#setupfiles-array) config entry to point at the `env-setup.js` file at the root of your project, you could set its value to `["/env-setup.js"]`._ -### `roots` [array] +### `roots` [array\] Default: `[""]` @@ -794,7 +794,7 @@ module.exports = { }; ``` -### `snapshotSerializers` [array] +### `snapshotSerializers` [array\] Default: `[]` @@ -928,7 +928,7 @@ Default: `{}` Test environment options that will be passed to the `testEnvironment`. The relevant options depend on the environment. For example you can override options given to [jsdom](https://github.com/tmpvar/jsdom) such as `{userAgent: "Agent/007"}`. -### `testMatch` [array] +### `testMatch` [array\] (default: `[ "**/__tests__/**/*.[jt]s?(x)", "**/?(*.)+(spec|test).[jt]s?(x)" ]`) @@ -936,9 +936,9 @@ The glob patterns Jest uses to detect test files. By default it looks for `.js`, See the [micromatch](https://github.com/jonschlinkert/micromatch) package for details of the patterns you can specify. -See also [`testRegex` [string | array]](#testregex-string-array-string), but note that you cannot specify both options. +See also [`testRegex` [string | array\]](#testregex-string-array-string), but note that you cannot specify both options. -### `testPathIgnorePatterns` [array] +### `testPathIgnorePatterns` [array\] Default: `["/node_modules/"]` @@ -946,11 +946,11 @@ An array of regexp pattern strings that are matched against all test paths befor These pattern strings match against the full path. Use the `` string token to include the path to your project's root directory to prevent it from accidentally ignoring all of your files in different environments that may have different root directories. Example: `["/build/", "/node_modules/"]`. -### `testRegex` [string | array] +### `testRegex` [string | array\] Default: `(/__tests__/.*|(\\.|/)(test|spec))\\.[jt]sx?$` -The pattern or patterns Jest uses to detect test files. 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`. See also [`testMatch` [array]](#testmatch-array-string), but note that you cannot specify both options. +The pattern or patterns Jest uses to detect test files. 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`. See also [`testMatch` [array\]](#testmatch-array-string), but note that you cannot specify both options. The following is a visualization of the default regex: @@ -1046,7 +1046,7 @@ Default: `real` Setting this value to `fake` allows the use of fake timers for functions such as `setTimeout`. Fake timers are useful when a piece of code sets a long timeout that we don't want to wait for in a test. -### `transform` [object] +### `transform` [object\] Default: `undefined` @@ -1058,7 +1058,7 @@ _Note: a transformer is only run once per file unless the file has changed. Duri _Note: if you are using the `babel-jest` transformer and want to use an additional code preprocessor, keep in mind that when "transform" is overwritten in any way the `babel-jest` is not loaded automatically anymore. If you want to use it to compile JavaScript code it has to be explicitly defined. See [babel-jest plugin](https://github.com/facebook/jest/tree/master/packages/babel-jest#setup)_ -### `transformIgnorePatterns` [array] +### `transformIgnorePatterns` [array\] Default: `["/node_modules/"]` @@ -1070,7 +1070,7 @@ Example: `["/bower_components/", "/node_modules/"]`. Sometimes it happens (especially in React Native or TypeScript projects) that 3rd party modules are published as untranspiled. Since all files inside `node_modules` are not transformed by default, Jest will not understand the code in these modules, resulting in syntax errors. To overcome this, you may use `transformIgnorePatterns` to whitelist such modules. You'll find a good example of this use case in [React Native Guide](https://jestjs.io/docs/en/tutorial-react-native#transformignorepatterns-customization). -### `unmockedModulePathPatterns` [array] +### `unmockedModulePathPatterns` [array\] Default: `[]` @@ -1086,7 +1086,7 @@ Default: `false` Indicates whether each individual test should be reported during the run. All errors will also still be shown on the bottom after execution. -### `watchPathIgnorePatterns` [array] +### `watchPathIgnorePatterns` [array\] Default: `[]` @@ -1094,7 +1094,7 @@ An array of RegExp patterns that are matched against all source file paths befor These patterns match against the full path. Use the `` string token to include the path to your project's root directory to prevent it from accidentally ignoring all of your files in different environments that may have different root directories. Example: `["/node_modules/"]`. -### `watchPlugins` [array] +### `watchPlugins` [array\] Default: `[]` diff --git a/website/versioned_docs/version-24.8/Configuration.md b/website/versioned_docs/version-24.8/Configuration.md index 5635054e8ea0..a40854a346a9 100644 --- a/website/versioned_docs/version-24.8/Configuration.md +++ b/website/versioned_docs/version-24.8/Configuration.md @@ -178,7 +178,7 @@ Default: `undefined` The directory where Jest should output its coverage files. -### `coveragePathIgnorePatterns` [array] +### `coveragePathIgnorePatterns` [array\] Default: `["/node_modules/"]` @@ -186,7 +186,7 @@ An array of regexp pattern strings that are matched against all file paths befor These pattern strings match against the full path. Use the `` string token to include the path to your project's root directory to prevent it from accidentally ignoring all of your files in different environments that may have different root directories. Example: `["/build/", "/node_modules/"]`. -### `coverageReporters` [array] +### `coverageReporters` [array\] Default: `["json", "lcov", "text", "clover"]` @@ -318,7 +318,7 @@ Default: `false` Make calling deprecated APIs throw helpful error messages. Useful for easing the upgrade process. -### `extraGlobals` [array] +### `extraGlobals` [array\] Default: `undefined` @@ -335,7 +335,7 @@ For example, if your tests call `Math` often, you can pass it by setting `extraG } ``` -### `forceCoverageMatch` [array] +### `forceCoverageMatch` [array\] Default: `['']` @@ -435,13 +435,13 @@ Default: `5` A number limiting the number of tests that are allowed to run at the same time when using `test.concurrent`. Any test above this limit will be queued and executed once a slot is released. -### `moduleDirectories` [array] +### `moduleDirectories` [array\] Default: `["node_modules"]` An array of directory names to be searched recursively up from the requiring module's location. 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"]` -### `moduleFileExtensions` [array] +### `moduleFileExtensions` [array\] Default: `["js", "json", "jsx", "ts", "tsx", "node"]` @@ -449,7 +449,7 @@ An array of file extensions your modules use. If you require modules without spe We recommend placing the extensions most commonly used in your project on the left, so if you are using TypeScript, you may want to consider moving "ts" and/or "tsx" to the beginning of the array. -### `moduleNameMapper` [object] +### `moduleNameMapper` [object\] Default: `null` @@ -477,7 +477,7 @@ The order in which the mappings are defined matters. Patterns are checked one by _Note: If you provide module name without boundaries `^$` it may cause hard to spot errors. E.g. `relay` will replace all modules which contain `relay` as a substring in its name: `relay`, `react-relay` and `graphql-relay` will all be pointed to your stub._ -### `modulePathIgnorePatterns` [array] +### `modulePathIgnorePatterns` [array\] Default: `[]` @@ -485,7 +485,7 @@ An array of regexp pattern strings that are matched against all module paths bef These pattern strings match against the full path. Use the `` string token to include the path to your project's root directory to prevent it from accidentally ignoring all of your files in different environments that may have different root directories. Example: `["/build/"]`. -### `modulePaths` [array] +### `modulePaths` [array\] Default: `[]` @@ -540,7 +540,7 @@ Default: `'prettier'` Sets the path to the [`prettier`](https://prettier.io/) node module used to update inline snapshots. -### `projects` [array] +### `projects` [array\] Default: `undefined` @@ -573,7 +573,7 @@ The projects feature can also be used to run multiple configurations or multiple _Note: When using multi project runner, it's recommended to add a `displayName` for each project. This will show the `displayName` of a project next to its tests._ -### `reporters` [array] +### `reporters` [array\] Default: `undefined` @@ -695,7 +695,7 @@ Oftentimes, you'll want to set this to `'src'` or `'lib'`, corresponding to wher _Note that using `''` as a string token in any other path-based config settings will refer back to this value. So, for example, if you want your [`setupFiles`](#setupfiles-array) config entry to point at the `env-setup.js` file at the root of your project, you could set its value to `["/env-setup.js"]`._ -### `roots` [array] +### `roots` [array\] Default: `[""]` @@ -794,7 +794,7 @@ module.exports = { }; ``` -### `snapshotSerializers` [array] +### `snapshotSerializers` [array\] Default: `[]` @@ -944,7 +944,7 @@ Default: `{}` Test environment options that will be passed to the `testEnvironment`. The relevant options depend on the environment. For example you can override options given to [jsdom](https://github.com/tmpvar/jsdom) such as `{userAgent: "Agent/007"}`. -### `testMatch` [array] +### `testMatch` [array\] (default: `[ "**/__tests__/**/*.[jt]s?(x)", "**/?(*.)+(spec|test).[jt]s?(x)" ]`) @@ -952,9 +952,9 @@ The glob patterns Jest uses to detect test files. By default it looks for `.js`, See the [micromatch](https://github.com/jonschlinkert/micromatch) package for details of the patterns you can specify. -See also [`testRegex` [string | array]](#testregex-string-array-string), but note that you cannot specify both options. +See also [`testRegex` [string | array\]](#testregex-string-array-string), but note that you cannot specify both options. -### `testPathIgnorePatterns` [array] +### `testPathIgnorePatterns` [array\] Default: `["/node_modules/"]` @@ -962,11 +962,11 @@ An array of regexp pattern strings that are matched against all test paths befor These pattern strings match against the full path. Use the `` string token to include the path to your project's root directory to prevent it from accidentally ignoring all of your files in different environments that may have different root directories. Example: `["/build/", "/node_modules/"]`. -### `testRegex` [string | array] +### `testRegex` [string | array\] Default: `(/__tests__/.*|(\\.|/)(test|spec))\\.[jt]sx?$` -The pattern or patterns Jest uses to detect test files. 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`. See also [`testMatch` [array]](#testmatch-array-string), but note that you cannot specify both options. +The pattern or patterns Jest uses to detect test files. 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`. See also [`testMatch` [array\]](#testmatch-array-string), but note that you cannot specify both options. The following is a visualization of the default regex: @@ -1087,7 +1087,7 @@ Default: `real` Setting this value to `fake` allows the use of fake timers for functions such as `setTimeout`. Fake timers are useful when a piece of code sets a long timeout that we don't want to wait for in a test. -### `transform` [object] +### `transform` [object\] Default: `undefined` @@ -1099,7 +1099,7 @@ _Note: a transformer is only run once per file unless the file has changed. Duri _Note: if you are using the `babel-jest` transformer and want to use an additional code preprocessor, keep in mind that when "transform" is overwritten in any way the `babel-jest` is not loaded automatically anymore. If you want to use it to compile JavaScript code it has to be explicitly defined. See [babel-jest plugin](https://github.com/facebook/jest/tree/master/packages/babel-jest#setup)_ -### `transformIgnorePatterns` [array] +### `transformIgnorePatterns` [array\] Default: `["/node_modules/"]` @@ -1111,7 +1111,7 @@ Example: `["/bower_components/", "/node_modules/"]`. Sometimes it happens (especially in React Native or TypeScript projects) that 3rd party modules are published as untranspiled. Since all files inside `node_modules` are not transformed by default, Jest will not understand the code in these modules, resulting in syntax errors. To overcome this, you may use `transformIgnorePatterns` to whitelist such modules. You'll find a good example of this use case in [React Native Guide](https://jestjs.io/docs/en/tutorial-react-native#transformignorepatterns-customization). -### `unmockedModulePathPatterns` [array] +### `unmockedModulePathPatterns` [array\] Default: `[]` @@ -1127,7 +1127,7 @@ Default: `false` Indicates whether each individual test should be reported during the run. All errors will also still be shown on the bottom after execution. -### `watchPathIgnorePatterns` [array] +### `watchPathIgnorePatterns` [array\] Default: `[]` @@ -1135,7 +1135,7 @@ An array of RegExp patterns that are matched against all source file paths befor These patterns match against the full path. Use the `` string token to include the path to your project's root directory to prevent it from accidentally ignoring all of your files in different environments that may have different root directories. Example: `["/node_modules/"]`. -### `watchPlugins` [array] +### `watchPlugins` [array\] Default: `[]` diff --git a/website/versioned_docs/version-24.9/Configuration.md b/website/versioned_docs/version-24.9/Configuration.md index 0afbb701c933..33914dd165a6 100644 --- a/website/versioned_docs/version-24.9/Configuration.md +++ b/website/versioned_docs/version-24.9/Configuration.md @@ -178,7 +178,7 @@ Default: `undefined` The directory where Jest should output its coverage files. -### `coveragePathIgnorePatterns` [array] +### `coveragePathIgnorePatterns` [array\] Default: `["/node_modules/"]` @@ -186,7 +186,7 @@ An array of regexp pattern strings that are matched against all file paths befor These pattern strings match against the full path. Use the `` string token to include the path to your project's root directory to prevent it from accidentally ignoring all of your files in different environments that may have different root directories. Example: `["/build/", "/node_modules/"]`. -### `coverageReporters` [array] +### `coverageReporters` [array\] Default: `["json", "lcov", "text", "clover"]` @@ -318,7 +318,7 @@ Default: `false` Make calling deprecated APIs throw helpful error messages. Useful for easing the upgrade process. -### `extraGlobals` [array] +### `extraGlobals` [array\] Default: `undefined` @@ -335,7 +335,7 @@ For example, if your tests call `Math` often, you can pass it by setting `extraG } ``` -### `forceCoverageMatch` [array] +### `forceCoverageMatch` [array\] Default: `['']` @@ -435,13 +435,13 @@ Default: `5` A number limiting the number of tests that are allowed to run at the same time when using `test.concurrent`. Any test above this limit will be queued and executed once a slot is released. -### `moduleDirectories` [array] +### `moduleDirectories` [array\] Default: `["node_modules"]` An array of directory names to be searched recursively up from the requiring module's location. 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"]` -### `moduleFileExtensions` [array] +### `moduleFileExtensions` [array\] Default: `["js", "json", "jsx", "ts", "tsx", "node"]` @@ -449,7 +449,7 @@ An array of file extensions your modules use. If you require modules without spe We recommend placing the extensions most commonly used in your project on the left, so if you are using TypeScript, you may want to consider moving "ts" and/or "tsx" to the beginning of the array. -### `moduleNameMapper` [object] +### `moduleNameMapper` [object\] Default: `null` @@ -477,7 +477,7 @@ The order in which the mappings are defined matters. Patterns are checked one by _Note: If you provide module name without boundaries `^$` it may cause hard to spot errors. E.g. `relay` will replace all modules which contain `relay` as a substring in its name: `relay`, `react-relay` and `graphql-relay` will all be pointed to your stub._ -### `modulePathIgnorePatterns` [array] +### `modulePathIgnorePatterns` [array\] Default: `[]` @@ -485,7 +485,7 @@ An array of regexp pattern strings that are matched against all module paths bef These pattern strings match against the full path. Use the `` string token to include the path to your project's root directory to prevent it from accidentally ignoring all of your files in different environments that may have different root directories. Example: `["/build/"]`. -### `modulePaths` [array] +### `modulePaths` [array\] Default: `[]` @@ -540,7 +540,7 @@ Default: `'prettier'` Sets the path to the [`prettier`](https://prettier.io/) node module used to update inline snapshots. -### `projects` [array] +### `projects` [array\] Default: `undefined` @@ -573,7 +573,7 @@ The projects feature can also be used to run multiple configurations or multiple _Note: When using multi project runner, it's recommended to add a `displayName` for each project. This will show the `displayName` of a project next to its tests._ -### `reporters` [array] +### `reporters` [array\] Default: `undefined` @@ -695,7 +695,7 @@ Oftentimes, you'll want to set this to `'src'` or `'lib'`, corresponding to wher _Note that using `''` as a string token in any other path-based config settings will refer back to this value. So, for example, if you want your [`setupFiles`](#setupfiles-array) config entry to point at the `env-setup.js` file at the root of your project, you could set its value to `["/env-setup.js"]`._ -### `roots` [array] +### `roots` [array\] Default: `[""]` @@ -794,7 +794,7 @@ module.exports = { }; ``` -### `snapshotSerializers` [array] +### `snapshotSerializers` [array\] Default: `[]` @@ -944,7 +944,7 @@ Default: `{}` Test environment options that will be passed to the `testEnvironment`. The relevant options depend on the environment. For example you can override options given to [jsdom](https://github.com/tmpvar/jsdom) such as `{userAgent: "Agent/007"}`. -### `testMatch` [array] +### `testMatch` [array\] (default: `[ "**/__tests__/**/*.[jt]s?(x)", "**/?(*.)+(spec|test).[jt]s?(x)" ]`) @@ -952,9 +952,9 @@ The glob patterns Jest uses to detect test files. By default it looks for `.js`, See the [micromatch](https://github.com/jonschlinkert/micromatch) package for details of the patterns you can specify. -See also [`testRegex` [string | array]](#testregex-string-array-string), but note that you cannot specify both options. +See also [`testRegex` [string | array\]](#testregex-string-array-string), but note that you cannot specify both options. -### `testPathIgnorePatterns` [array] +### `testPathIgnorePatterns` [array\] Default: `["/node_modules/"]` @@ -962,11 +962,11 @@ An array of regexp pattern strings that are matched against all test paths befor These pattern strings match against the full path. Use the `` string token to include the path to your project's root directory to prevent it from accidentally ignoring all of your files in different environments that may have different root directories. Example: `["/build/", "/node_modules/"]`. -### `testRegex` [string | array] +### `testRegex` [string | array\] Default: `(/__tests__/.*|(\\.|/)(test|spec))\\.[jt]sx?$` -The pattern or patterns Jest uses to detect test files. 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`. See also [`testMatch` [array]](#testmatch-array-string), but note that you cannot specify both options. +The pattern or patterns Jest uses to detect test files. 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`. See also [`testMatch` [array\]](#testmatch-array-string), but note that you cannot specify both options. The following is a visualization of the default regex: @@ -1087,7 +1087,7 @@ Default: `real` Setting this value to `fake` allows the use of fake timers for functions such as `setTimeout`. Fake timers are useful when a piece of code sets a long timeout that we don't want to wait for in a test. -### `transform` [object] +### `transform` [object\] Default: `undefined` @@ -1101,7 +1101,7 @@ _Note: a transformer is only run once per file unless the file has changed. Duri _Note: if you are using the `babel-jest` transformer and want to use an additional code preprocessor, keep in mind that when "transform" is overwritten in any way the `babel-jest` is not loaded automatically anymore. If you want to use it to compile JavaScript code it has to be explicitly defined. See [babel-jest plugin](https://github.com/facebook/jest/tree/master/packages/babel-jest#setup)_ -### `transformIgnorePatterns` [array] +### `transformIgnorePatterns` [array\] Default: `["/node_modules/"]` @@ -1113,7 +1113,7 @@ Example: `["/bower_components/", "/node_modules/"]`. Sometimes it happens (especially in React Native or TypeScript projects) that 3rd party modules are published as untranspiled. Since all files inside `node_modules` are not transformed by default, Jest will not understand the code in these modules, resulting in syntax errors. To overcome this, you may use `transformIgnorePatterns` to whitelist such modules. You'll find a good example of this use case in [React Native Guide](https://jestjs.io/docs/en/tutorial-react-native#transformignorepatterns-customization). -### `unmockedModulePathPatterns` [array] +### `unmockedModulePathPatterns` [array\] Default: `[]` @@ -1129,7 +1129,7 @@ Default: `false` Indicates whether each individual test should be reported during the run. All errors will also still be shown on the bottom after execution. -### `watchPathIgnorePatterns` [array] +### `watchPathIgnorePatterns` [array\] Default: `[]` @@ -1137,7 +1137,7 @@ An array of RegExp patterns that are matched against all source file paths befor These patterns match against the full path. Use the `` string token to include the path to your project's root directory to prevent it from accidentally ignoring all of your files in different environments that may have different root directories. Example: `["/node_modules/"]`. -### `watchPlugins` [array] +### `watchPlugins` [array\] Default: `[]`