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
Copy file name to clipboardExpand all lines: CHANGELOG.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -75,6 +75,7 @@
75
75
-`[@jest/expect-utils]` Fix not addressing to Sets and Maps as objects without keys ([#14873](https://github.com/jestjs/jest/pull/14873))
76
76
-`[jest-leak-detector]` Make leak-detector more aggressive when running GC ([#14526](https://github.com/jestjs/jest/pull/14526))
77
77
-`[jest-runtime]` Properly handle re-exported native modules in ESM via CJS ([#14589](https://github.com/jestjs/jest/pull/14589))
78
+
-`[jest-schemas, jest-types]`[**BREAKING**] Fix type of `testFailureExitCode` config option([#15232](https://github.com/jestjs/jest/pull/15232))
78
79
-`[jest-util]` Make sure `isInteractive` works in a browser ([#14552](https://github.com/jestjs/jest/pull/14552))
79
80
-`[pretty-format]`[**BREAKING**] Print `ArrayBuffer` and `DataView` correctly ([#14290](https://github.com/jestjs/jest/pull/14290))
80
81
-`[pretty-format]` Fixed a bug where "anonymous custom elements" were not being printed as expected. ([#15138](https://github.com/jestjs/jest/pull/15138))
@@ -118,6 +119,7 @@
118
119
-`[docs]` Updated `.toHaveBeenCalled()` documentation to correctly reflect its functionality ([#14842](https://github.com/jestjs/jest/pull/14842))
119
120
-`[docs]` Link NestJS documentation on testing with Jest ([#14940](https://github.com/jestjs/jest/pull/14940))
120
121
-`[docs]``Revised documentation for .toHaveBeenCalled()` to accurately depict its functionality. ([#14853](https://github.com/jestjs/jest/pull/14853))
122
+
-`[docs]` Removed ExpressJS reference link from documentation due to dead link ([#15270](https://github.com/jestjs/jest/pull/15270))
Copy file name to clipboardExpand all lines: docs/CLI.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -407,6 +407,8 @@ jest --seed=1324
407
407
408
408
If this option is not specified Jest will randomly generate the value. You can use the [`--showSeed`](#--showseed) flag to print the seed in the test report summary.
409
409
410
+
Jest uses the seed internally for shuffling the order in which test suites are run. If the [`--randomize`](#--randomize) option is used, the seed is also used for shuffling the order of tests within each `describe` block. When dealing with flaky tests, rerunning with the same seed might help reproduce the failure.
Copy file name to clipboardExpand all lines: docs/GlobalAPI.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -251,7 +251,7 @@ Use `describe.each` if you keep duplicating the same test suites with different
251
251
-`%$` - Number of the test case.
252
252
-`%%` - single percent sign ('%'). This does not consume an argument.
253
253
- Or generate unique test titles by injecting properties of test case object with `$variable`
254
-
- To inject nested object values use you can supply a keyPath i.e. `$variable.path.to.value`
254
+
- To inject nested object values use you can supply a keyPath i.e. `$variable.path.to.value` (only works for ["own" properites](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty), e.g. `$variable.constructor.name` wouldn't work)
255
255
- You can use `$#` to inject the index of the test case
256
256
- You cannot use `$variable` with the `printf` formatting except for `%%`
257
257
-`fn`: `Function` the suite of tests to be run, this is the function that will receive the parameters in each row as function arguments.
@@ -305,7 +305,7 @@ describe.each([
305
305
- First row of variable name column headings separated with `|`
306
306
- One or more subsequent rows of data supplied as template literal expressions using `${value}` syntax.
307
307
-`name`: `String` the title of the test suite, use `$variable` to inject test data into the suite title from the tagged template expressions, and `$#` for the index of the row.
308
-
- To inject nested object values use you can supply a keyPath i.e. `$variable.path.to.value`
308
+
- To inject nested object values use you can supply a keyPath i.e. `$variable.path.to.value` (only works for ["own" properites](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty), e.g. `$variable.constructor.name` wouldn't work)
309
309
-`fn`: `Function` the suite of tests to be run, this is the function that will receive the test data object.
310
310
- Optionally, you can provide a `timeout` (in milliseconds) for specifying how long to wait for each row before aborting. The default timeout is 5 seconds.
311
311
@@ -574,7 +574,7 @@ test.concurrent.each([
574
574
- First row of variable name column headings separated with `|`
575
575
- One or more subsequent rows of data supplied as template literal expressions using `${value}` syntax.
576
576
-`name`: `String` the title of the test, use `$variable` to inject test data into the test title from the tagged template expressions.
577
-
- To inject nested object values use you can supply a keyPath i.e. `$variable.path.to.value`
577
+
- To inject nested object values use you can supply a keyPath i.e. `$variable.path.to.value` (only works for ["own" properites](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty), e.g. `$variable.constructor.name` wouldn't work)
578
578
-`fn`: `Function` the test to be run, this is the function that will receive the test data object, **this will have to be an asynchronous function**.
579
579
- Optionally, you can provide a `timeout` (in milliseconds) for specifying how long to wait for each row before aborting. The default timeout is 5 seconds.
580
580
@@ -697,7 +697,7 @@ Use `test.each` if you keep duplicating the same test with different data. `test
697
697
-`%$` - Number of the test case.
698
698
-`%%` - single percent sign ('%'). This does not consume an argument.
699
699
- Or generate unique test titles by injecting properties of test case object with `$variable`
700
-
- To inject nested object values use you can supply a keyPath i.e. `$variable.path.to.value`
700
+
- To inject nested object values use you can supply a keyPath i.e. `$variable.path.to.value` (only works for ["own" properites](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty), e.g. `$variable.constructor.name` wouldn't work)
701
701
- You can use `$#` to inject the index of the test case
702
702
- You cannot use `$variable` with the `printf` formatting except for `%%`
703
703
-`fn`: `Function` the test to be run, this is the function that will receive the parameters in each row as function arguments.
@@ -731,7 +731,7 @@ test.each([
731
731
- First row of variable name column headings separated with `|`
732
732
- One or more subsequent rows of data supplied as template literal expressions using `${value}` syntax.
733
733
-`name`: `String` the title of the test, use `$variable` to inject test data into the test title from the tagged template expressions.
734
-
- To inject nested object values use you can supply a keyPath i.e. `$variable.path.to.value`
734
+
- To inject nested object values use you can supply a keyPath i.e. `$variable.path.to.value` (only works for ["own" properites](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty), e.g. `$variable.constructor.name` wouldn't work)
735
735
-`fn`: `Function` the test to be run, this is the function that will receive the test data object.
736
736
- Optionally, you can provide a `timeout` (in milliseconds) for specifying how long to wait for each row before aborting. The default timeout is 5 seconds.
Copy file name to clipboardExpand all lines: docs/TestingFrameworks.md
-4Lines changed: 0 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,10 +32,6 @@ Jest is a universal testing platform, with the ability to adapt to any JavaScrip
32
32
33
33
-[Writing Tests](https://redux.js.org/recipes/writing-tests) by Redux docs
34
34
35
-
## Express.js
36
-
37
-
-[How to test Express.js with Jest and Supertest](http://www.albertgao.xyz/2017/05/24/how-to-test-expressjs-with-jest-and-supertest/) by Albert Gao ([@albertgao](https://twitter.com/albertgao))
38
-
39
35
## GatsbyJS
40
36
41
37
-[Unit Testing](https://www.gatsbyjs.org/docs/unit-testing/) by GatsbyJS docs
Copy file name to clipboardExpand all lines: docs/Troubleshooting.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -142,7 +142,7 @@ Retry with [`--no-cache`](CLI.md#--cache). Jest caches transformed module files
142
142
If a promise doesn't resolve at all, this error might be thrown:
143
143
144
144
```bash
145
-
- Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.`
145
+
- Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.
146
146
```
147
147
148
148
Most commonly this is being caused by conflicting Promise implementations. Consider replacing the global promise implementation with your own, for example `globalThis.Promise = jest.requireActual('promise');` and/or consolidate the used Promise libraries to a single one.
0 commit comments