Skip to content
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [18.x, 20.x, 22.x, 24.x]
node-version: [20.x, 22.x, 24.x]
name: Node v${{ matrix.node-version }}
runs-on: ${{ inputs.os }}

Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

- `[jest-runtime]` Fix issue where user cannot utilize dynamic import despite specifying `--experimental-vm-modules` Node option ([#15842](https://github.com/jestjs/jest/pull/15842))

## Chore & Maintenance

- `[*]` [**BREAKING**] Drop support for end-of-life Node.js version 18 ([#15850](https://github.com/jestjs/jest/pull/15850))

## 30.2.0

### Chore & Maintenance
Expand Down
24 changes: 0 additions & 24 deletions e2e/__tests__/__snapshots__/wrongEnv.test.ts.snap
Original file line number Diff line number Diff line change
@@ -1,29 +1,5 @@
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`Wrong globals for environment on node <=18 print useful error for navigator 1`] = `
"FAIL __tests__/node.js
✕ use navigator
○ skipped use document
○ skipped use window

● use navigator

The error below may be caused by using the wrong test environment, see https://jestjs.io/docs/configuration#testenvironment-string.
Consider using the "jsdom" test environment.

ReferenceError: navigator is not defined

31 |
32 | test('use navigator', () => {
> 33 | const userAgent = navigator.userAgent;
| ^
34 |
35 | console.log(userAgent);
36 |

at Object.navigator (__tests__/node.js:33:21)"
`;

exports[`Wrong globals for environment print useful error for document 1`] = `
"FAIL __tests__/node.js
✕ use document
Expand Down
7 changes: 0 additions & 7 deletions e2e/__tests__/wrongEnv.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,6 @@ describe('Wrong globals for environment', () => {
assertFailuresAndSnapshot(['node', '-t=document']);
});

// Node.js 18 is the last LTS version, which is missing the global 'navigator'
onNodeVersions('<=18', () => {
it('print useful error for navigator', () => {
assertFailuresAndSnapshot(['node', '-t=navigator']);
});
});

it('print useful error for unref', () => {
assertFailuresAndSnapshot(['jsdom', '-t=unref']);
});
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@
"logo": "https://opencollective.com/jest/logo.txt"
},
"engines": {
"node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"
"node": "^20.0.0 || ^22.0.0 || >=24.0.0"
},
"resolutions": {
"@types/node": "~18.14",
Expand Down
2 changes: 1 addition & 1 deletion packages/babel-jest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"@babel/core": "^7.11.0 || ^8.0.0-0"
},
"engines": {
"node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"
"node": "^20.0.0 || ^22.0.0 || >=24.0.0"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/babel-plugin-jest-hoist/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"directory": "packages/babel-plugin-jest-hoist"
},
"engines": {
"node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"
"node": "^20.0.0 || ^22.0.0 || >=24.0.0"
},
"license": "MIT",
"main": "./build/index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/babel-preset-jest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"@babel/core": "^7.11.0 || ^8.0.0-beta.1"
},
"engines": {
"node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"
"node": "^20.0.0 || ^22.0.0 || >=24.0.0"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/create-jest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"prompts": "^2.4.2"
},
"engines": {
"node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"
"node": "^20.0.0 || ^22.0.0 || >=24.0.0"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/diff-sequences/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"diff"
],
"engines": {
"node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"
"node": "^20.0.0 || ^22.0.0 || >=24.0.0"
},
"main": "./build/index.js",
"types": "./build/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/expect-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"jest-matcher-utils": "workspace:*"
},
"engines": {
"node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"
"node": "^20.0.0 || ^22.0.0 || >=24.0.0"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/expect/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"immutable": "^5.1.2"
},
"engines": {
"node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"
"node": "^20.0.0 || ^22.0.0 || >=24.0.0"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-changed-files/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"p-limit": "^3.1.0"
},
"engines": {
"node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"
"node": "^20.0.0 || ^22.0.0 || >=24.0.0"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-circus/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"tempy": "^1.0.1"
},
"engines": {
"node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"
"node": "^20.0.0 || ^22.0.0 || >=24.0.0"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"jest": "./bin/jest.js"
},
"engines": {
"node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"
"node": "^20.0.0 || ^22.0.0 || >=24.0.0"
},
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"typescript": "^5.8.3"
},
"engines": {
"node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"
"node": "^20.0.0 || ^22.0.0 || >=24.0.0"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-console/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"@jest/test-utils": "workspace:*"
},
"engines": {
"node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"
"node": "^20.0.0 || ^22.0.0 || >=24.0.0"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
}
},
"engines": {
"node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"
"node": "^20.0.0 || ^22.0.0 || >=24.0.0"
},
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-create-cache-key-function/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"jest-util": "workspace:*"
},
"engines": {
"node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"
"node": "^20.0.0 || ^22.0.0 || >=24.0.0"
},
"license": "MIT",
"main": "./build/index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-diff/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"@jest/test-utils": "workspace:*"
},
"engines": {
"node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"
"node": "^20.0.0 || ^22.0.0 || >=24.0.0"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-docblock/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"@types/node": "*"
},
"engines": {
"node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"
"node": "^20.0.0 || ^22.0.0 || >=24.0.0"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-each/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"pretty-format": "workspace:*"
},
"engines": {
"node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"
"node": "^20.0.0 || ^22.0.0 || >=24.0.0"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-environment-jsdom-abstract/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
}
},
"engines": {
"node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"
"node": "^20.0.0 || ^22.0.0 || >=24.0.0"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-environment-jsdom/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
}
},
"engines": {
"node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"
"node": "^20.0.0 || ^22.0.0 || >=24.0.0"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-environment-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"test": "yarn test:globals-cleanup-off && yarn test:globals-cleanup-soft && yarn test:globals-cleanup-on"
},
"engines": {
"node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"
"node": "^20.0.0 || ^22.0.0 || >=24.0.0"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-environment/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"jest-mock": "workspace:*"
},
"engines": {
"node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"
"node": "^20.0.0 || ^22.0.0 || >=24.0.0"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-expect/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"jest-snapshot": "workspace:*"
},
"engines": {
"node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"
"node": "^20.0.0 || ^22.0.0 || >=24.0.0"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-fake-timers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"@types/sinonjs__fake-timers": "^8.1.5"
},
"engines": {
"node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"
"node": "^20.0.0 || ^22.0.0 || >=24.0.0"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-get-type/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"directory": "packages/jest-get-type"
},
"engines": {
"node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"
"node": "^20.0.0 || ^22.0.0 || >=24.0.0"
},
"license": "MIT",
"main": "./build/index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-globals/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"directory": "packages/jest-globals"
},
"engines": {
"node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"
"node": "^20.0.0 || ^22.0.0 || >=24.0.0"
},
"license": "MIT",
"main": "./build/index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-haste-map/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"fsevents": "^2.3.3"
},
"engines": {
"node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"
"node": "^20.0.0 || ^22.0.0 || >=24.0.0"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-jasmine2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"@types/co": "^4.6.6"
},
"engines": {
"node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"
"node": "^20.0.0 || ^22.0.0 || >=24.0.0"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-leak-detector/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"@types/node": "*"
},
"engines": {
"node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"
"node": "^20.0.0 || ^22.0.0 || >=24.0.0"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-matcher-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"directory": "packages/jest-matcher-utils"
},
"engines": {
"node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"
"node": "^20.0.0 || ^22.0.0 || >=24.0.0"
},
"license": "MIT",
"main": "./build/index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-message-util/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"directory": "packages/jest-message-util"
},
"engines": {
"node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"
"node": "^20.0.0 || ^22.0.0 || >=24.0.0"
},
"license": "MIT",
"main": "./build/index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-mock/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"jest-util": "workspace:*"
},
"engines": {
"node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"
"node": "^20.0.0 || ^22.0.0 || >=24.0.0"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-pattern/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"jest-regex-util": "workspace:*"
},
"engines": {
"node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"
"node": "^20.0.0 || ^22.0.0 || >=24.0.0"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-phabricator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"@jest/test-result": "workspace:*"
},
"engines": {
"node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"
"node": "^20.0.0 || ^22.0.0 || >=24.0.0"
},
"license": "MIT",
"main": "./build/index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-regex-util/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"@types/node": "*"
},
"engines": {
"node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"
"node": "^20.0.0 || ^22.0.0 || >=24.0.0"
},
"license": "MIT",
"main": "./build/index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-reporters/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
}
},
"engines": {
"node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"
"node": "^20.0.0 || ^22.0.0 || >=24.0.0"
},
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-resolve-dependencies/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"jest-runtime": "workspace:*"
},
"engines": {
"node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"
"node": "^20.0.0 || ^22.0.0 || >=24.0.0"
},
"publishConfig": {
"access": "public"
Expand Down
Loading
Loading