You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-`[jest-environment-jsdom]` Do not reset the global.document too early on teardown ([#11871](https://github.com/facebook/jest/pull/11871))
16
16
-`[jest-transform]` Improve error and warning messages ([#11998](https://github.com/facebook/jest/pull/11998))
Copy file name to clipboardExpand all lines: docs/CLI.md
+16-16Lines changed: 16 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -220,10 +220,6 @@ _Note: This option is only supported using the default `jest-circus` test runner
220
220
221
221
Prints the test results in JSON. This mode will send all other test output and user messages to stderr.
222
222
223
-
### `--outputFile=<filename>`
224
-
225
-
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).
226
-
227
223
### `--lastCommit`
228
224
229
225
Run all tests affected by file changes in the last commit made. Behaves similarly to `--onlyChanged`.
@@ -258,6 +254,10 @@ Activates notifications for test results. Good for when you don't want your cons
258
254
259
255
Alias: `-o`. Attempts to identify which tests to run based on which files have changed in the current repository. Only works if you're running tests in a git/hg repository at the moment and requires a static dependency graph (ie. no dynamic requires).
260
256
257
+
### `--outputFile=<filename>`
258
+
259
+
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).
260
+
261
261
### `--passWithNoTests`
262
262
263
263
Allows the test suite to pass when no files are found.
@@ -280,16 +280,16 @@ A list of paths to directories that Jest should use to search for files in.
280
280
281
281
Alias: `-i`. Run all tests serially in the current process, rather than creating a worker pool of child processes that run tests. This can be useful for debugging.
282
282
283
-
### `--selectProjects <project1> ... <projectN>`
284
-
285
-
Run only the tests of the specified projects. Jest uses the attribute `displayName` in the configuration to identify each project. If you use this option, you should provide a `displayName` to all your projects.
286
-
287
283
### `--runTestsByPath`
288
284
289
285
Run only the tests that were specified with their exact paths.
290
286
291
287
_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_
292
288
289
+
### `--selectProjects <project1> ... <projectN>`
290
+
291
+
Run only the tests of the specified projects. Jest uses the attribute `displayName` in the configuration to identify each project. If you use this option, you should provide a `displayName` to all your projects.
292
+
293
293
### `--setupFilesAfterEnv <path1> ... <pathN>`
294
294
295
295
A list of paths to modules that run some code to configure or to set up the testing framework before each test. Beware that files imported by the setup scripts will not be mocked during testing.
@@ -306,12 +306,6 @@ Prevent tests from printing messages through the console.
306
306
307
307
A JSON string with options that will be passed to the `testEnvironment`. The relevant options depend on the environment.
308
308
309
-
### `--testNamePattern=<regex>`
310
-
311
-
Alias: `-t`. Run only tests 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`.
312
-
313
-
_Note: The regex is matched against the full name, which is a combination of the test name and all its surrounding describe blocks._
314
-
315
309
### `--testLocationInResults`
316
310
317
311
Adds a `location` field to test results. Useful if you want to report the location of a test in a reporter.
@@ -325,16 +319,22 @@ Note that `column` is 0-indexed while `line` is not.
325
319
}
326
320
```
327
321
328
-
### `--testPathPattern=<regex>`
322
+
### `--testNamePattern=<regex>`
329
323
330
-
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 `\\`.
324
+
Alias: -t. Run only tests 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.
325
+
326
+
Note: The regex is matched against the full name, which is a combination of the test name and all its surrounding describe blocks.
331
327
332
328
### `--testPathIgnorePatterns=<regex>|[array]`
333
329
334
330
A single or array of regexp pattern strings that are tested against all tests paths before executing the test. Contrary to `--testPathPattern`, it will only run those tests with a path that does not match with the provided regexp expressions.
335
331
336
332
To pass as an array use escaped parentheses and space delimited regexps such as `\(/node_modules/ /tests/e2e/\)`. Alternatively, you can omit parentheses by combining regexps into a single regexp like `/node_modules/|/tests/e2e/`. These two examples are equivalent.
337
333
334
+
### `--testPathPattern=<regex>`
335
+
336
+
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 `\\`.
Copy file name to clipboardExpand all lines: website/versioned_docs/version-25.x/CLI.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -286,12 +286,6 @@ Print your Jest config and then exits.
286
286
287
287
Prevent tests from printing messages through the console.
288
288
289
-
### `--testNamePattern=<regex>`
290
-
291
-
Alias: `-t`. Run only tests 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`.
292
-
293
-
_Note: The regex is matched against the full name, which is a combination of the test name and all its surrounding describe blocks._
294
-
295
289
### `--testLocationInResults`
296
290
297
291
Adds a `location` field to test results. Useful if you want to report the location of a test in a reporter.
@@ -305,16 +299,22 @@ Note that `column` is 0-indexed while `line` is not.
305
299
}
306
300
```
307
301
308
-
### `--testPathPattern=<regex>`
302
+
### `--testNamePattern=<regex>`
309
303
310
-
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 `\\`.
304
+
Alias: `-t`. Run only tests 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`.
305
+
306
+
_Note: The regex is matched against the full name, which is a combination of the test name and all its surrounding describe blocks._
311
307
312
308
### `--testPathIgnorePatterns=<regex>|[array]`
313
309
314
310
A single or array of regexp pattern strings that are tested against all tests paths before executing the test. Contrary to `--testPathPattern`, it will only run those tests with a path that does not match with the provided regexp expressions.
315
311
316
312
To pass as an array use escaped parentheses and space delimited regexps such as `\(/node_modules/ /tests/e2e/\)`. Alternatively, you can omit parentheses by combining regexps into a single regexp like `/node_modules/|/tests/e2e/`. These two examples are equivalent.
317
313
314
+
### `--testPathPattern=<regex>`
315
+
316
+
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 `\\`.
Copy file name to clipboardExpand all lines: website/versioned_docs/version-26.x/CLI.md
+12-12Lines changed: 12 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -280,16 +280,16 @@ A list of paths to directories that Jest should use to search for files in.
280
280
281
281
Alias: `-i`. Run all tests serially in the current process, rather than creating a worker pool of child processes that run tests. This can be useful for debugging.
282
282
283
-
### `--selectProjects <project1> ... <projectN>`
284
-
285
-
Run only the tests of the specified projects. Jest uses the attribute `displayName` in the configuration to identify each project. If you use this option, you should provide a `displayName` to all your projects.
286
-
287
283
### `--runTestsByPath`
288
284
289
285
Run only the tests that were specified with their exact paths.
290
286
291
287
_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_
292
288
289
+
### `--selectProjects <project1> ... <projectN>`
290
+
291
+
Run only the tests of the specified projects. Jest uses the attribute `displayName` in the configuration to identify each project. If you use this option, you should provide a `displayName` to all your projects.
292
+
293
293
### `--setupFilesAfterEnv <path1> ... <pathN>`
294
294
295
295
A list of paths to modules that run some code to configure or to set up the testing framework before each test. Beware that files imported by the setup scripts will not be mocked during testing.
@@ -302,12 +302,6 @@ Print your Jest config and then exits.
302
302
303
303
Prevent tests from printing messages through the console.
304
304
305
-
### `--testNamePattern=<regex>`
306
-
307
-
Alias: `-t`. Run only tests 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`.
308
-
309
-
_Note: The regex is matched against the full name, which is a combination of the test name and all its surrounding describe blocks._
310
-
311
305
### `--testLocationInResults`
312
306
313
307
Adds a `location` field to test results. Useful if you want to report the location of a test in a reporter.
@@ -321,16 +315,22 @@ Note that `column` is 0-indexed while `line` is not.
321
315
}
322
316
```
323
317
324
-
### `--testPathPattern=<regex>`
318
+
### `--testNamePattern=<regex>`
325
319
326
-
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 `\\`.
320
+
Alias: `-t`. Run only tests 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`.
321
+
322
+
_Note: The regex is matched against the full name, which is a combination of the test name and all its surrounding describe blocks._
327
323
328
324
### `--testPathIgnorePatterns=<regex>|[array]`
329
325
330
326
A single or array of regexp pattern strings that are tested against all tests paths before executing the test. Contrary to `--testPathPattern`, it will only run those tests with a path that does not match with the provided regexp expressions.
331
327
332
328
To pass as an array use escaped parentheses and space delimited regexps such as `\(/node_modules/ /tests/e2e/\)`. Alternatively, you can omit parentheses by combining regexps into a single regexp like `/node_modules/|/tests/e2e/`. These two examples are equivalent.
333
329
330
+
### `--testPathPattern=<regex>`
331
+
332
+
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 `\\`.
Copy file name to clipboardExpand all lines: website/versioned_docs/version-27.0/CLI.md
+12-12Lines changed: 12 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -280,16 +280,16 @@ A list of paths to directories that Jest should use to search for files in.
280
280
281
281
Alias: `-i`. Run all tests serially in the current process, rather than creating a worker pool of child processes that run tests. This can be useful for debugging.
282
282
283
-
### `--selectProjects <project1> ... <projectN>`
284
-
285
-
Run only the tests of the specified projects. Jest uses the attribute `displayName` in the configuration to identify each project. If you use this option, you should provide a `displayName` to all your projects.
286
-
287
283
### `--runTestsByPath`
288
284
289
285
Run only the tests that were specified with their exact paths.
290
286
291
287
_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_
292
288
289
+
### `--selectProjects <project1> ... <projectN>`
290
+
291
+
Run only the tests of the specified projects. Jest uses the attribute `displayName` in the configuration to identify each project. If you use this option, you should provide a `displayName` to all your projects.
292
+
293
293
### `--setupFilesAfterEnv <path1> ... <pathN>`
294
294
295
295
A list of paths to modules that run some code to configure or to set up the testing framework before each test. Beware that files imported by the setup scripts will not be mocked during testing.
@@ -302,12 +302,6 @@ Print your Jest config and then exits.
302
302
303
303
Prevent tests from printing messages through the console.
304
304
305
-
### `--testNamePattern=<regex>`
306
-
307
-
Alias: `-t`. Run only tests 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`.
308
-
309
-
_Note: The regex is matched against the full name, which is a combination of the test name and all its surrounding describe blocks._
310
-
311
305
### `--testLocationInResults`
312
306
313
307
Adds a `location` field to test results. Useful if you want to report the location of a test in a reporter.
@@ -321,16 +315,22 @@ Note that `column` is 0-indexed while `line` is not.
321
315
}
322
316
```
323
317
324
-
### `--testPathPattern=<regex>`
318
+
### `--testNamePattern=<regex>`
325
319
326
-
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 `\\`.
320
+
Alias: `-t`. Run only tests 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`.
321
+
322
+
_Note: The regex is matched against the full name, which is a combination of the test name and all its surrounding describe blocks._
327
323
328
324
### `--testPathIgnorePatterns=<regex>|[array]`
329
325
330
326
A single or array of regexp pattern strings that are tested against all tests paths before executing the test. Contrary to `--testPathPattern`, it will only run those tests with a path that does not match with the provided regexp expressions.
331
327
332
328
To pass as an array use escaped parentheses and space delimited regexps such as `\(/node_modules/ /tests/e2e/\)`. Alternatively, you can omit parentheses by combining regexps into a single regexp like `/node_modules/|/tests/e2e/`. These two examples are equivalent.
333
329
330
+
### `--testPathPattern=<regex>`
331
+
332
+
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 `\\`.
Copy file name to clipboardExpand all lines: website/versioned_docs/version-27.1/CLI.md
+12-12Lines changed: 12 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -280,16 +280,16 @@ A list of paths to directories that Jest should use to search for files in.
280
280
281
281
Alias: `-i`. Run all tests serially in the current process, rather than creating a worker pool of child processes that run tests. This can be useful for debugging.
282
282
283
-
### `--selectProjects <project1> ... <projectN>`
284
-
285
-
Run only the tests of the specified projects. Jest uses the attribute `displayName` in the configuration to identify each project. If you use this option, you should provide a `displayName` to all your projects.
286
-
287
283
### `--runTestsByPath`
288
284
289
285
Run only the tests that were specified with their exact paths.
290
286
291
287
_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_
292
288
289
+
### `--selectProjects <project1> ... <projectN>`
290
+
291
+
Run only the tests of the specified projects. Jest uses the attribute `displayName` in the configuration to identify each project. If you use this option, you should provide a `displayName` to all your projects.
292
+
293
293
### `--setupFilesAfterEnv <path1> ... <pathN>`
294
294
295
295
A list of paths to modules that run some code to configure or to set up the testing framework before each test. Beware that files imported by the setup scripts will not be mocked during testing.
@@ -302,12 +302,6 @@ Print your Jest config and then exits.
302
302
303
303
Prevent tests from printing messages through the console.
304
304
305
-
### `--testNamePattern=<regex>`
306
-
307
-
Alias: `-t`. Run only tests 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`.
308
-
309
-
_Note: The regex is matched against the full name, which is a combination of the test name and all its surrounding describe blocks._
310
-
311
305
### `--testLocationInResults`
312
306
313
307
Adds a `location` field to test results. Useful if you want to report the location of a test in a reporter.
@@ -321,16 +315,22 @@ Note that `column` is 0-indexed while `line` is not.
321
315
}
322
316
```
323
317
324
-
### `--testPathPattern=<regex>`
318
+
### `--testNamePattern=<regex>`
325
319
326
-
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 `\\`.
320
+
Alias: `-t`. Run only tests 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`.
321
+
322
+
_Note: The regex is matched against the full name, which is a combination of the test name and all its surrounding describe blocks._
327
323
328
324
### `--testPathIgnorePatterns=<regex>|[array]`
329
325
330
326
A single or array of regexp pattern strings that are tested against all tests paths before executing the test. Contrary to `--testPathPattern`, it will only run those tests with a path that does not match with the provided regexp expressions.
331
327
332
328
To pass as an array use escaped parentheses and space delimited regexps such as `\(/node_modules/ /tests/e2e/\)`. Alternatively, you can omit parentheses by combining regexps into a single regexp like `/node_modules/|/tests/e2e/`. These two examples are equivalent.
333
329
330
+
### `--testPathPattern=<regex>`
331
+
332
+
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 `\\`.
0 commit comments