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
+3
Original file line number
Diff line number
Diff line change
@@ -50,6 +50,7 @@
50
50
### Fixes
51
51
52
52
-`[babel-plugin-jest-hoist]` Use `denylist` instead of the deprecated `blacklist` for Babel 8 support ([#14109](https://github.com/jestjs/jest/pull/14109))
53
+
-`[babel-plugin-jest-hoist]` Do not rely on buggy Babel behaviour ([#15415](https://github.com/jestjs/jest/pull/15415))
53
54
-`[expect]` Check error instance type for `toThrow/toThrowError` ([#14576](https://github.com/jestjs/jest/pull/14576))
54
55
-`[expect]` Improve diff for failing `expect.objectContaining` ([#15038](https://github.com/jestjs/jest/pull/15038))
55
56
-`[expect]` Use `Array.isArray` to check if an array is an `Array` ([#15101](https://github.com/jestjs/jest/pull/15101))
@@ -84,6 +85,7 @@
84
85
-[**BREAKING**]`--testPathPattern` is now `--testPathPatterns`
85
86
-[**BREAKING**] Specifying `testPathPatterns` when programmatically calling `watch` must be specified as `new TestPathPatterns(patterns)`, where `TestPathPatterns` can be imported from `@jest/pattern`
86
87
-`[jest-reporters, jest-runner]` Unhandled errors without stack get correctly logged to console ([#14619](https://github.com/jestjs/jest/pull/14619))
88
+
-`[jest-util]` Always load `mjs` files with `import` ([#15447](https://github.com/jestjs/jest/pull/15447))
87
89
-`[jest-worker]` Properly handle a circular reference error when worker tries to send an assertion fails where either the expected or actual value is circular ([#15191](https://github.com/jestjs/jest/pull/15191))
88
90
-`[jest-worker]` Properly handle a BigInt when worker tries to send an assertion fails where either the expected or actual value is BigInt ([#15191](https://github.com/jestjs/jest/pull/15191))
89
91
@@ -120,6 +122,7 @@
120
122
-`[docs]` Link NestJS documentation on testing with Jest ([#14940](https://github.com/jestjs/jest/pull/14940))
121
123
-`[docs]``Revised documentation for .toHaveBeenCalled()` to accurately depict its functionality. ([#14853](https://github.com/jestjs/jest/pull/14853))
122
124
-`[docs]` Removed ExpressJS reference link from documentation due to dead link ([#15270](https://github.com/jestjs/jest/pull/15270))
125
+
-`[docs]` Removed `Running AngularJS Tests with Jest reference` link from documentation due to dead link ([#15270](https://github.com/jestjs/jest/pull/15311))
Copy file name to clipboardExpand all lines: docs/CLI.md
+2
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-5
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" properties](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" properties](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" properties](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" properties](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" properties](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
-1
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,6 @@ Jest is a universal testing platform, with the ability to adapt to any JavaScrip
17
17
## AngularJS
18
18
19
19
-[Testing an AngularJS app with Jest](https://medium.com/aya-experience/testing-an-angularjs-app-with-jest-3029a613251) by Matthieu Lux ([@Swiip](https://twitter.com/Swiip))
20
-
-[Running AngularJS Tests with Jest](https://engineering.talentpair.com/running-angularjs-tests-with-jest-49d0cc9c6d26) by Ben Brandt ([@benjaminbrandt](https://twitter.com/benjaminbrandt))
21
20
-[AngularJS Unit Tests with Jest Actions (Traditional Chinese)](https://dwatow.github.io/2019/08-14-angularjs/angular-jest/?fbclid=IwAR2SrqYg_o6uvCQ79FdNPeOxs86dUqB6pPKgd9BgnHt1kuIDRyRM-ch11xg) by Chris Wang ([@dwatow](https://github.com/dwatow))
0 commit comments