Skip to content

Commit 57a0ef1

Browse files
authored
chore!: drop support for node.js version 16 (#15623)
1 parent 91ae99c commit 57a0ef1

File tree

75 files changed

+136
-165
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+136
-165
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,5 @@ workflows:
5858
name: test-node-partial-<< matrix.node-version >>
5959
matrix:
6060
parameters:
61-
node-version: ['16', '18', '20', '22', '23']
61+
node-version: ['18', '20', '22', '23', '24']
6262
- test-jest-jasmine

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
strategy:
1616
fail-fast: false
1717
matrix:
18-
node-version: [16.x, 18.x, 20.x, 22.x, 23.x]
18+
node-version: [18.x, 20.x, 22.x, 23.x, 24.x]
1919
name: Node v${{ matrix.node-version }}
2020
runs-on: ${{ inputs.os }}
2121

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@
116116
### Chore & Maintenance
117117

118118
- `[*]` Increase version of `micromatch` to `^4.0.7` ([#15082](https://github.com/jestjs/jest/pull/15082))
119-
- `[*]` [**BREAKING**] Drop support for Node.js versions 14, 19 and 21 ([#14460](https://github.com/jestjs/jest/pull/14460), [#15118](https://github.com/jestjs/jest/pull/15118))
119+
- `[*]` [**BREAKING**] Drop support for Node.js versions 14, 16, 19 and 21 ([#14460](https://github.com/jestjs/jest/pull/14460), [#15118](https://github.com/jestjs/jest/pull/15118), [#15623](https://github.com/jestjs/jest/pull/15623))
120120
- `[*]` [**BREAKING**] Drop support for `[email protected]`, minimum version is now `5.0` ([#14542](https://github.com/jestjs/jest/pull/14542))
121121
- `[*]` Depend on exact versions of monorepo dependencies instead of `^` range ([#14553](https://github.com/jestjs/jest/pull/14553))
122122
- `[*]` [**BREAKING**] Add ESM wrapper for all of Jest's modules ([#14661](https://github.com/jestjs/jest/pull/14661))

constraints.pro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ gen_enforced_field(WorkspaceCwd, 'publishConfig.access', null) :-
5353
workspace_field(WorkspaceCwd, 'private', true).
5454

5555
% Enforces the engines.node field for public workspace
56-
gen_enforced_field(WorkspaceCwd, 'engines.node', '^16.10.0 || ^18.12.0 || >=20.0.0') :-
56+
gen_enforced_field(WorkspaceCwd, 'engines.node', '^18.14.0 || ^20.0.0 || >=22.0.0') :-
5757
\+ workspace_field(WorkspaceCwd, 'private', true).
5858

5959
% Enforces the main and types field to start with ./

e2e/__tests__/__snapshots__/jest.config.ts.test.ts.snap

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
22

3-
exports[`on node >=23.6 invalid JS in jest.config.ts (node with native TS support) 1`] = `
3+
exports[`on node >=24 invalid JS in jest.config.ts (node with native TS support) 1`] = `
4+
"Error: Jest: Failed to parse the TypeScript config file <<REPLACED>>
5+
SyntaxError [ERR_INVALID_TYPESCRIPT_SYNTAX]: Expected ';', got 'string literal (ll break this file yo, 'll break this file yo)'"
6+
`;
7+
8+
exports[`on node ^23.6 invalid JS in jest.config.ts (node with native TS support) 1`] = `
49
"Error: Jest: Failed to parse the TypeScript config file <<REPLACED>>
510
SyntaxError [ERR_INVALID_TYPESCRIPT_SYNTAX]: x Expected ';', got 'string literal (ll break this file yo, 'll break this file yo)'
611
,----

e2e/__tests__/jest.config.ts.test.ts

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,35 @@ onNodeVersions('<23.6', () => {
135135
});
136136
});
137137

138-
onNodeVersions('>=23.6', () => {
138+
onNodeVersions('^23.6', () => {
139+
test('invalid JS in jest.config.ts (node with native TS support)', () => {
140+
writeFiles(DIR, {
141+
'__tests__/a-giraffe.js': "test('giraffe', () => expect(1).toBe(1));",
142+
'jest.config.ts': "export default i'll break this file yo",
143+
'package.json': '{}',
144+
});
145+
146+
const {stderr, exitCode} = runJest(DIR, ['-w=1', '--ci=false'], {
147+
nodeOptions: '--no-warnings',
148+
});
149+
expect(
150+
stderr
151+
// Remove the stack trace from the error message
152+
.slice(0, Math.max(0, stderr.indexOf('at readConfigFileAndSetRootDir')))
153+
.trim()
154+
// Replace the path to the config file with a placeholder
155+
.replace(
156+
/(Error: Jest: Failed to parse the TypeScript config file).*$/m,
157+
'$1 <<REPLACED>>',
158+
),
159+
).toMatchSnapshot();
160+
expect(exitCode).toBe(1);
161+
});
162+
});
163+
164+
onNodeVersions('>=24', () => {
165+
// todo fixme
166+
// eslint-disable-next-line jest/no-identical-title
139167
test('invalid JS in jest.config.ts (node with native TS support)', () => {
140168
writeFiles(DIR, {
141169
'__tests__/a-giraffe.js': "test('giraffe', () => expect(1).toBe(1));",

package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
1818
"@lerna-lite/cli": "^3.0.0",
1919
"@lerna-lite/publish": "^3.0.0",
2020
"@microsoft/api-extractor": "^7.35.0",
21-
"@tsconfig/node16": "^16.1.0",
21+
"@tsconfig/node18": "^18.2.4",
2222
"@types/babel__core": "^7.1.14",
2323
"@types/babel__generator": "^7.0.0",
2424
"@types/babel__template": "^7.0.2",
25-
"@types/node": "^16.10.0",
25+
"@types/node": "^18.14",
2626
"@types/which": "^3.0.0",
2727
"ansi-regex": "^5.0.1",
2828
"ansi-styles": "^5.0.0",
@@ -192,10 +192,10 @@
192192
"logo": "https://opencollective.com/jest/logo.txt"
193193
},
194194
"engines": {
195-
"node": "^16.10.0 || ^18.12.0 || >=20.0.0"
195+
"node": "^18.14.0 || ^20.0.0 || >=22.0.0"
196196
},
197197
"resolutions": {
198-
"@types/node": "~16.18.0",
198+
"@types/node": "~18.14",
199199
"@types/react": "^18.2.21",
200200
"ansi-escapes/type-fest": "^2.0.0",
201201
"babel-jest": "workspace:*",
@@ -204,7 +204,8 @@
204204
"lru-cache@^10.0.1": "patch:lru-cache@npm:10.4.3#./.yarn/patches/lru-cache-npm-10.4.3-30c10b861a.patch",
205205
"lru-cache@^10.2.0": "patch:lru-cache@npm:10.4.3#./.yarn/patches/lru-cache-npm-10.4.3-30c10b861a.patch",
206206
"lru-cache@^10.2.2": "patch:lru-cache@npm:10.4.3#./.yarn/patches/lru-cache-npm-10.4.3-30c10b861a.patch",
207-
"ts-node@^10.5.0": "patch:ts-node@npm:^10.5.0#./.yarn/patches/ts-node-npm-10.9.1-6c268be7f4.patch"
207+
"ts-node@^10.5.0": "patch:ts-node@npm:^10.5.0#./.yarn/patches/ts-node-npm-10.9.1-6c268be7f4.patch",
208+
"typescript": "~5.5.4"
208209
},
209210
"packageManager": "[email protected]"
210211
}

packages/babel-jest/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"@babel/core": "^7.11.0"
3838
},
3939
"engines": {
40-
"node": "^16.10.0 || ^18.12.0 || >=20.0.0"
40+
"node": "^18.14.0 || ^20.0.0 || >=22.0.0"
4141
},
4242
"publishConfig": {
4343
"access": "public"

packages/babel-plugin-jest-hoist/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"directory": "packages/babel-plugin-jest-hoist"
88
},
99
"engines": {
10-
"node": "^16.10.0 || ^18.12.0 || >=20.0.0"
10+
"node": "^18.14.0 || ^20.0.0 || >=22.0.0"
1111
},
1212
"license": "MIT",
1313
"main": "./build/index.js",

packages/babel-preset-jest/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"@babel/core": "^7.11.0"
2121
},
2222
"engines": {
23-
"node": "^16.10.0 || ^18.12.0 || >=20.0.0"
23+
"node": "^18.14.0 || ^20.0.0 || >=22.0.0"
2424
},
2525
"publishConfig": {
2626
"access": "public"

0 commit comments

Comments
 (0)