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
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,20 +3,26 @@
3
3
### Features
4
4
5
5
-`[jest-config]`[**BREAKING**] Add `mts` and `cts` to default `moduleFileExtensions` config ([#14369](https://github.com/facebook/jest/pull/14369))
6
+
-`[jest-config]`[**BREAKING**] Update `testMatch` and `testRegex` default option for supporting `mjs`, `cjs`, `mts`, and `cts` ([#14584](https://github.com/jestjs/jest/pull/14584))
6
7
-`[@jest/core]`[**BREAKING**] Group together open handles with the same stack trace ([#13417](https://github.com/jestjs/jest/pull/13417), & [#14543](https://github.com/jestjs/jest/pull/14543))
-`[jest-environment-jsdom]`[**BREAKING**] Upgrade JSDOM to v22 ([#13825](https://github.com/jestjs/jest/pull/13825))
9
10
-`[@jest/fake-timers]`[**BREAKING**] Upgrade `@sinonjs/fake-timers` to v11 ([#14544](https://github.com/jestjs/jest/pull/14544))
10
11
-`[@jest/schemas]` Upgrade `@sinclair/typebox` to v0.31 ([#14072](https://github.com/jestjs/jest/pull/14072))
12
+
-`[@jest/types]``test.each()`: Accept a readonly (`as const`) table properly ([#14565](https://github.com/jestjs/jest/pull/14565))
11
13
-`[jest-snapshot]`[**BREAKING**] Add support for [Error causes](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/cause) in snapshots ([#13965](https://github.com/facebook/jest/pull/13965))
14
+
-`[jest-snapshot]` Support Prettier 3 ([#14566](https://github.com/facebook/jest/pull/14566))
12
15
-`[pretty-format]`[**BREAKING**] Do not render empty string children (`''`) in React plugin ([#14470](https://github.com/facebook/jest/pull/14470))
13
16
14
17
### Fixes
15
18
16
19
-`[babel-plugin-jest-hoist]` Use `denylist` instead of the deprecated `blacklist` for Babel 8 support ([#14109](https://github.com/jestjs/jest/pull/14109))
20
+
-`[expect]` Check error instance type for `toThrow/toThrowError` ([#14576](https://github.com/jestjs/jest/pull/14576))
17
21
-`[jest-circus]`[**BREAKING**] Prevent false test failures caused by promise rejections handled asynchronously ([#14315](https://github.com/jestjs/jest/pull/14315))
22
+
-`[jest-config]` Make sure to respect `runInBand` option ([#14578](https://github.com/facebook/jest/pull/14578))
18
23
-`[@jest/expect-utils]` Fix comparison of `DataView` ([#14408](https://github.com/jestjs/jest/pull/14408))
19
24
-`[jest-leak-detector]` Make leak-detector more aggressive when running GC ([#14526](https://github.com/jestjs/jest/pull/14526))
25
+
-`[jest-runtime]` Properly handle re-exported native modules in ESM via CJS ([#14589](https://github.com/jestjs/jest/pull/14589))
20
26
-`[jest-util]` Make sure `isInteractive` works in a browser ([#14552](https://github.com/jestjs/jest/pull/14552))
21
27
-`[pretty-format]`[**BREAKING**] Print `ArrayBuffer` and `DataView` correctly ([#14290](https://github.com/facebook/jest/pull/14290))
22
28
-`[jest-cli]` When specifying paths on the command line, only match against the relative paths of the test files ([#12519](https://github.com/facebook/jest/pull/12519))
Copy file name to clipboardExpand all lines: docs/Configuration.md
+2-38Lines changed: 2 additions & 38 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1145,42 +1145,6 @@ Default: `'prettier'`
1145
1145
1146
1146
Sets the path to the [`prettier`](https://prettier.io/) node module used to update inline snapshots.
1147
1147
1148
-
<details>
1149
-
<summary>Prettier version 3 is not supported!</summary>
1150
-
1151
-
You can either pass `prettierPath: null` in your config to disable using prettier if you don't need it, or use v2 of Prettier solely for Jest.
1152
-
1153
-
```json title="package.json"
1154
-
{
1155
-
"devDependencies": {
1156
-
"prettier-2": "npm:prettier@^2"
1157
-
}
1158
-
}
1159
-
```
1160
-
1161
-
```js tab
1162
-
/**@type{import('jest').Config}*/
1163
-
constconfig= {
1164
-
prettierPath:require.resolve('prettier-2'),
1165
-
};
1166
-
1167
-
module.exports= config;
1168
-
```
1169
-
1170
-
```ts tab
1171
-
importtype {Config} from'jest';
1172
-
1173
-
const config:Config= {
1174
-
prettierPath: require.resolve('prettier-2'),
1175
-
};
1176
-
1177
-
exportdefaultconfig;
1178
-
```
1179
-
1180
-
We hope to support Prettier v3 seamlessly out of the box in a future version of Jest. See [this](https://github.com/jestjs/jest/issues/14305) tracking issue.
The glob 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`.
2042
2006
@@ -2060,7 +2024,7 @@ These pattern strings match against the full path. Use the `<rootDir>` string to
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<string>]](#testmatch-arraystring), but note that you cannot specify both options.
Copy file name to clipboardExpand all lines: docs/ExpectAPI.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
@@ -1505,7 +1505,7 @@ The type declaration of the matcher can live in a `.d.ts` file or in an imported
1505
1505
1506
1506
:::tip
1507
1507
1508
-
Instead of importing `toBeWithinRange` module to the test file, you can enable the matcher for all tests by moving the `expect.extend` call to a [`setupFilesAfterEnv`](Configuration.md/#setupfilesafterenv-array) script:
1508
+
Instead of importing `toBeWithinRange` module to the test file, you can enable the matcher for all tests by moving the `expect.extend` call to a [`setupFilesAfterEnv`](Configuration.md#setupfilesafterenv-array) script:
Use the [`maxConcurrency`](Configuration.md/#maxconcurrency-number) configuration option to prevent Jest from executing more than the specified amount of tests at the same time.
528
+
Use the [`maxConcurrency`](Configuration.md#maxconcurrency-number) configuration option to prevent Jest from executing more than the specified amount of tests at the same time.
Also under the alias: `it.each(table)(name, fn)` and ``it.each`table`(name, fn)``
676
+
Also under the alias: `it.each(table)(name, fn)` and ``it.each`table`(name, fn)``
677
677
678
678
Use `test.each` if you keep duplicating the same test with different data. `test.each` allows you to write the test once and pass data in.
679
679
@@ -722,7 +722,7 @@ test.each([
722
722
});
723
723
```
724
724
725
-
#### 2. ``test.each`table`(name, fn, timeout)``
725
+
#### 2. ``test.each`table`(name, fn, timeout)``
726
726
727
727
-`table`: `Tagged Template Literal`
728
728
- First row of variable name column headings separated with `|`
@@ -779,7 +779,7 @@ test.failing('it is equal', () => {
779
779
780
780
### `test.failing.each(name, fn, timeout)`
781
781
782
-
Also under the alias: `it.failing.each(table)(name, fn)` and ``it.failing.each`table`(name, fn)``
782
+
Also under the alias: `it.failing.each(table)(name, fn)` and ``it.failing.each`table`(name, fn)``
783
783
784
784
:::note
785
785
@@ -851,7 +851,7 @@ Usually you wouldn't check code using `test.only` into source control - you woul
851
851
852
852
### `test.only.each(table)(name, fn)`
853
853
854
-
Also under the aliases: `it.only.each(table)(name, fn)`, `fit.each(table)(name, fn)`, ``it.only.each`table`(name, fn)`` and ``fit.each`table`(name, fn)``
854
+
Also under the aliases: `it.only.each(table)(name, fn)`, `fit.each(table)(name, fn)`, ``it.only.each`table`(name, fn)`` and ``fit.each`table`(name, fn)``
855
855
856
856
Use `test.only.each` if you want to only run specific tests with different test data.
857
857
@@ -873,7 +873,7 @@ test('will not be run', () => {
873
873
});
874
874
```
875
875
876
-
#### ``test.only.each`table`(name, fn)``
876
+
#### ``test.only.each`table`(name, fn)``
877
877
878
878
```js
879
879
test.only.each`
@@ -914,7 +914,7 @@ You could comment the test out, but it's often a bit nicer to use `test.skip` be
914
914
915
915
### `test.skip.each(table)(name, fn)`
916
916
917
-
Also under the aliases: `it.skip.each(table)(name, fn)`, `xit.each(table)(name, fn)`, `xtest.each(table)(name, fn)`, ``it.skip.each`table`(name, fn)``, ``xit.each`table`(name, fn)`` and ``xtest.each`table`(name, fn)``
917
+
Also under the aliases: `it.skip.each(table)(name, fn)`, `xit.each(table)(name, fn)`, `xtest.each(table)(name, fn)`, ``it.skip.each`table`(name, fn)``, ``xit.each`table`(name, fn)`` and ``xtest.each`table`(name, fn)``
918
918
919
919
Use `test.skip.each` if you want to stop running a collection of data driven tests.
Copy file name to clipboardExpand all lines: docs/JestObjectAPI.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -344,17 +344,17 @@ Returns the `jest` object for chaining.
344
344
345
345
:::tip
346
346
347
-
Writing tests in TypeScript? Use the [`jest.Mocked`](MockFunctionAPI.md/#jestmockedsource) utility type or the [`jest.mocked()`](MockFunctionAPI.md/#jestmockedsource-options) helper method to have your mocked modules typed.
347
+
Writing tests in TypeScript? Use the [`jest.Mocked`](MockFunctionAPI.md#jestmockedsource) utility type or the [`jest.mocked()`](MockFunctionAPI.md#jestmockedsource-options) helper method to have your mocked modules typed.
348
348
349
349
:::
350
350
351
351
### `jest.Mocked<Source>`
352
352
353
-
See [TypeScript Usage](MockFunctionAPI.md/#jestmockedsource) chapter of Mock Functions page for documentation.
353
+
See [TypeScript Usage](MockFunctionAPI.md#jestmockedsource) chapter of Mock Functions page for documentation.
354
354
355
355
### `jest.mocked(source, options?)`
356
356
357
-
See [TypeScript Usage](MockFunctionAPI.md/#jestmockedsource-options) chapter of Mock Functions page for documentation.
357
+
See [TypeScript Usage](MockFunctionAPI.md#jestmockedsource-options) chapter of Mock Functions page for documentation.
Copy file name to clipboardExpand all lines: docs/MockFunctions.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
@@ -272,7 +272,7 @@ const otherObj = {
272
272
273
273
## Mock Names
274
274
275
-
You can optionally provide a name for your mock functions, which will be displayed instead of `'jest.fn()'` in the test error output. Use [`.mockName()`](MockFunctionAPI.md/#mockfnmocknamename) if you want to be able to quickly identify the mock function reporting an error in your test output.
275
+
You can optionally provide a name for your mock functions, which will be displayed instead of `'jest.fn()'` in the test error output. Use [`.mockName()`](MockFunctionAPI.md#mockfnmocknamename) if you want to be able to quickly identify the mock function reporting an error in your test output.
0 commit comments