Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: using html entities for AUTOGENERATED_TABLE_OF_CONTENTS [WIP] #9202

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,7 @@ We skipped 24.2.0 because a draft was accidentally published. Please use `24.3.0
- `[diff-sequences]` Add performance benchmark to package ([#7603](https://github.com/facebook/jest/pull/7603))
- `[*]` Replace as many `Object.assign` with object spread as possible ([#7627](https://github.com/facebook/jest/pull/7627))
- `[ci]` Initial support for Azure Pipelines ([#7556](https://github.com/facebook/jest/pull/7556))
- `[docs]` updating tag delimter to < > in docs(md) file to make docusaurus's table of content work correctly ([#9202](https://github.com/facebook/jest/pull/9202))

### Performance

Expand Down
42 changes: 21 additions & 21 deletions docs/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,15 +177,15 @@ Default: `undefined`

The directory where Jest should output its coverage files.

### `coveragePathIgnorePatterns` [array<string>]
### `coveragePathIgnorePatterns` [array&lt;string&gt;]

Default: `["/node_modules/"]`

An array of regexp pattern strings that are matched against all file paths before executing the test. If the file path matches any of the patterns, coverage information will be skipped.

These pattern strings match against the full path. Use the `<rootDir>` 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: `["<rootDir>/build/", "<rootDir>/node_modules/"]`.

### `coverageReporters` [array<string>]
### `coverageReporters` [array&lt;string&gt;]

Default: `["json", "lcov", "text", "clover"]`

Expand Down Expand Up @@ -317,7 +317,7 @@ Default: `false`

Make calling deprecated APIs throw helpful error messages. Useful for easing the upgrade process.

### `extraGlobals` [array<string>]
### `extraGlobals` [array&lt;string&gt;]

Default: `undefined`

Expand All @@ -334,7 +334,7 @@ For example, if your tests call `Math` often, you can pass it by setting `extraG
}
```

### `forceCoverageMatch` [array<string>]
### `forceCoverageMatch` [array&lt;string&gt;]

Default: `['']`

Expand Down Expand Up @@ -434,21 +434,21 @@ 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<string>]
### `moduleDirectories` [array&lt;string&gt;]

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<string>]
### `moduleFileExtensions` [array&lt;string&gt;]

Default: `["js", "json", "jsx", "ts", "tsx", "node"]`

An array of file extensions your modules use. If you require modules without specifying a file extension, these are the extensions Jest will look for, in left-to-right order.

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<string, string>]
### `moduleNameMapper` [object&lt;string, string&gt;]

Default: `null`

Expand Down Expand Up @@ -476,15 +476,15 @@ 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<string>]
### `modulePathIgnorePatterns` [array&lt;string&gt]

Default: `[]`

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. If a given module's path matches any of the patterns, it will not be `require()`-able in the test environment.

These pattern strings match against the full path. Use the `<rootDir>` 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: `["<rootDir>/build/"]`.

### `modulePaths` [array<string>]
### `modulePaths` [array&lt;string&gt]

Default: `[]`

Expand Down Expand Up @@ -539,7 +539,7 @@ Default: `'prettier'`

Sets the path to the [`prettier`](https://prettier.io/) node module used to update inline snapshots.

### `projects` [array<string | ProjectConfig>]
### `projects` [array&lt;string | ProjectConfig&gt;]

Default: `undefined`

Expand Down Expand Up @@ -572,7 +572,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<moduleName | [moduleName, options]>]
### `reporters` [array&lt;moduleName | [moduleName, options]&gt]

Default: `undefined`

Expand Down Expand Up @@ -695,7 +695,7 @@ Oftentimes, you'll want to set this to `'src'` or `'lib'`, corresponding to wher

_Note that using `'<rootDir>'` 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 `["<rootDir>/env-setup.js"]`._

### `roots` [array<string>]
### `roots` [array&lt;string&gt]

Default: `["<rootDir>"]`

Expand Down Expand Up @@ -794,7 +794,7 @@ module.exports = {
};
```

### `snapshotSerializers` [array<string>]
### `snapshotSerializers` [array&lt;string&gt]

Default: `[]`

Expand Down Expand Up @@ -942,7 +942,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<string>]
### `testMatch` [array&lt;string&gt]

(default: `[ "**/__tests__/**/*.[jt]s?(x)", "**/?(*.)+(spec|test).[jt]s?(x)" ]`)

Expand All @@ -952,15 +952,15 @@ See the [micromatch](https://github.com/jonschlinkert/micromatch) package for de

See also [`testRegex` [string | array<string>]](#testregex-string-array-string), but note that you cannot specify both options.

### `testPathIgnorePatterns` [array<string>]
### `testPathIgnorePatterns` [array&lt;string&gt]

Default: `["/node_modules/"]`

An array of regexp pattern strings that are matched against all test paths before executing the test. If the test path matches any of the patterns, it will be skipped.

These pattern strings match against the full path. Use the `<rootDir>` 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: `["<rootDir>/build/", "<rootDir>/node_modules/"]`.

### `testRegex` [string | array<string>]
### `testRegex` [string | array&lt;string&gt]

Default: `(/__tests__/.*|(\\.|/)(test|spec))\\.[jt]sx?$`

Expand Down Expand Up @@ -1085,7 +1085,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<string, pathToTransformer | [pathToTransformer, object]>]
### `transform` [object&ltstring, pathToTransformer | [pathToTransformer, object]&gt]

Default: `undefined`

Expand All @@ -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<string>]
### `transformIgnorePatterns` [array&lt;string&gt]

Default: `["/node_modules/"]`

Expand All @@ -1111,7 +1111,7 @@ Example: `["<rootDir>/bower_components/", "<rootDir>/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<string>]
### `unmockedModulePathPatterns` [array&lt;string&gt]

Default: `[]`

Expand All @@ -1127,15 +1127,15 @@ 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<string>]
### `watchPathIgnorePatterns` [array&lt;string&gt]

Default: `[]`

An array of RegExp patterns that are matched against all source file paths before re-running tests in watch mode. If the file path matches any of the patterns, when it is updated, it will not trigger a re-run of tests.

These patterns match against the full path. Use the `<rootDir>` 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: `["<rootDir>/node_modules/"]`.

### `watchPlugins` [array<string | [string, Object]>]
### `watchPlugins` [array&ltstring | [string, Object]&gt]

Default: `[]`

Expand Down
24 changes: 12 additions & 12 deletions website/versioned_docs/version-22.x/CLI.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ _Note: CLI options take precedence over values from the [Configuration](Configur

## Reference

### `jest <regexForTestFiles>`
### `jest &lt;regexForTestFiles&gt;`

When you run `jest` with an argument, that argument is treated as a regular expression to match against files in your project. It is possible to run test suites by providing a pattern. Only the files that the pattern matches will be picked up and executed. Depending on your terminal, you may need to quote this argument: `jest "my.*(complex)?pattern"`. On Windows, you will need to use `/` as a path separator or escape `\` as `\\`.

Expand Down Expand Up @@ -122,15 +122,15 @@ When this option is provided, Jest will assume it is running in a CI environment

Deletes the Jest cache directory and then exits without running tests. Will delete `cacheDirectory` if the option is passed, or Jest's default cache directory. The default cache directory can be found by calling `jest --showConfig`. _Note: clearing the cache will reduce performance._

### `--collectCoverageFrom=<glob>`
### `--collectCoverageFrom=&lt;glob&gt;`

An array of glob patterns relative to <rootDir> matching the files that coverage info needs to be collected from.

### `--colors`

Forces test results output highlighting even if stdout is not a TTY.

### `--config=<path>`
### `--config=&lt;path&gt;`

Alias: `-c`. The path to a Jest config file specifying how to find and execute tests. If no `rootDir` is set in the config, the directory containing the config file is assumed to be the rootDir for the project. This can also be a JSON-encoded value which Jest will use as configuration.

Expand All @@ -142,15 +142,15 @@ Indicates that test coverage information should be collected and reported in the

Print debugging info about your Jest config.

### `--env=<environment>`
### `--env=&lt;environment&gt;`

The test environment used for all tests. This can point to any file or node module. Examples: `jsdom`, `node` or `path/to/my-environment.js`.

### `--expand`

Alias: `-e`. Use this flag to show full diffs and errors instead of a patch.

### `--findRelatedTests <spaceSeparatedListOfSourceFiles>`
### `--findRelatedTests &lt;spaceSeparatedListOfSourceFiles&gt;`

Find and run the tests that cover a space separated list of source files that were passed in as arguments. Useful for pre-commit hook integration to run the minimal amount of tests necessary.

Expand All @@ -166,7 +166,7 @@ Show the help information, similar to this page.

Prints the test results in JSON. This mode will send all other test output and user messages to stderr.

### `--outputFile=<filename>`
### `--outputFile=&lt;filename&gt;`

Write test results to a file when the `--json` option is also specified. The returned JSON structure is documented in [testResultsProcessor](Configuration.md#testResultsProcessor-string).

Expand All @@ -182,7 +182,7 @@ Lists all tests as JSON that Jest will run given the arguments, and exits. This

Logs the heap usage after every test. Useful to debug memory leaks. Use together with `--runInBand` and `--expose-gc` in node.

### `--maxWorkers=<num>`
### `--maxWorkers=&lt;num&gt;`

Alias: `-w`. Specifies the maximum number of workers the worker-pool will spawn for running tests. In single run mode, this defaults to the number of the cores available on your machine minus one for the main thread. In watch mode, this defaults to half of the available cores on your machine to ensure Jest is unobtrusive and does not grind your machine to a halt. It may be useful to adjust this in resource limited environments like CIs but the defaults should be adequate for most use-cases.

Expand All @@ -202,7 +202,7 @@ Alias: `-o`. Attempts to identify which tests to run based on which files have c

Allows the test suite to pass when no files are found.

### `--projects <project1> ... <projectN>`
### `--projects &lt;project1&gt; ... &lt;projectN&gt;`

Run tests from one or more projects.

Expand All @@ -216,7 +216,7 @@ Run only the tests that were specified with their exact paths.

_Note: The default regex matching works fine on small runs, but becomes slow if provided with multiple patterns and/or against a lot of tests. This option replaces the regex matching logic and by that optimizes the time it takes Jest to filter specific test files_

### `--setupTestFrameworkScriptFile=<file>`
### `--setupTestFrameworkScriptFile=&lt;file&gt;`

The path to a module that runs some code to configure or set up the testing framework before each test. Beware that files imported by the setup script will not be mocked during testing.

Expand All @@ -228,7 +228,7 @@ Print your Jest config and then exits.

Prevent tests from printing messages through the console.

### `--testNamePattern=<regex>`
### `--testNamePattern=&lt;regex&gt;`

Alias: `-t`. Run only tests and test suites with a name that matches the regex. For example, suppose you want to run only tests related to authorization which will have names like `"GET /api/posts with auth"`, then you can use `jest -t=auth`.

Expand All @@ -245,11 +245,11 @@ Note that `column` is 0-indexed while `line` is not.
}
```

### `--testPathPattern=<regex>`
### `--testPathPattern=&lt;regex&gt;`

A regexp pattern string that is matched against all tests paths before executing the test. On Windows, you will need to use `/` as a path separator or escape `\` as `\\`.

### `--testRunner=<path>`
### `--testRunner=&lt;path&gt;`

Lets you specify a custom test runner.

Expand Down
Loading