Skip to content

Commit 7e484b2

Browse files
authored
chore: drop node 10 and node 15 (#12220)
1 parent 3ccde93 commit 7e484b2

73 files changed

Lines changed: 216 additions & 360 deletions

File tree

Some content is hidden

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

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,5 +68,5 @@ workflows:
6868
partial: true
6969
matrix:
7070
parameters:
71-
node-version: ['10', '12', '15', '16', '17']
71+
node-version: ['12', '16', '17']
7272
- test-jest-jasmine

.github/workflows/nodejs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
strategy:
7474
fail-fast: false
7575
matrix:
76-
node-version: [10.x, 12.x, 14.x, 15.x, 16.x, 17.x]
76+
node-version: [12.x, 14.x, 16.x, 17.x]
7777
os: [ubuntu-latest, macOS-latest, windows-latest]
7878
runs-on: ${{ matrix.os }}
7979
needs: prepare-yarn-cache

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
### Chore & Maintenance
88

9+
- `[*]` [**BREAKING**] Drop support for Node v10 and v15 and target first LTS `16.13.0` ([#12220](https://github.com/facebook/jest/pull/12220))
10+
911
### Performance
1012

1113
## 27.5.1

e2e/__tests__/__snapshots__/moduleNameMapper.test.ts.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ exports[`moduleNameMapper wrong array configuration 1`] = `
4141
12 | module.exports = () => 'test';
4242
13 |
4343
44-
at createNoMappedModuleFoundError (../../packages/jest-resolve/build/resolver.js:579:17)
44+
at createNoMappedModuleFoundError (../../packages/jest-resolve/build/resolver.js:568:17)
4545
at Object.require (index.js:10:1)"
4646
`;
4747

@@ -70,6 +70,6 @@ exports[`moduleNameMapper wrong configuration 1`] = `
7070
12 | module.exports = () => 'test';
7171
13 |
7272
73-
at createNoMappedModuleFoundError (../../packages/jest-resolve/build/resolver.js:579:17)
73+
at createNoMappedModuleFoundError (../../packages/jest-resolve/build/resolver.js:568:17)
7474
at Object.require (index.js:10:1)"
7575
`;

e2e/__tests__/__snapshots__/resolveNoFileExtensions.test.ts.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@ exports[`show error message with matching files 1`] = `
3737
| ^
3838
9 |
3939
40-
at Resolver.resolveModule (../../packages/jest-resolve/build/resolver.js:324:11)
40+
at Resolver.resolveModule (../../packages/jest-resolve/build/resolver.js:317:11)
4141
at Object.require (index.js:8:18)"
4242
`;

e2e/__tests__/consoleLogOutputWhenRunInBand.test.ts

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ const DIR = path.resolve(__dirname, '../console-log-output-when-run-in-band');
1414
beforeEach(() => cleanup(DIR));
1515
afterAll(() => cleanup(DIR));
1616

17-
const nodeMajorVersion = Number(process.versions.node.split('.')[0]);
18-
1917
test('prints console.logs when run with forceExit', () => {
2018
writeFiles(DIR, {
2119
'__tests__/a-banana.js': `
@@ -24,26 +22,14 @@ test('prints console.logs when run with forceExit', () => {
2422
'package.json': '{}',
2523
});
2624

27-
const {stderr, exitCode, ...res} = runJest(DIR, [
25+
const {stderr, stdout, exitCode} = runJest(DIR, [
2826
'-i',
2927
'--ci=false',
3028
'--forceExit',
3129
]);
32-
let {stdout} = res;
3330

3431
const {rest, summary} = extractSummary(stderr);
3532

36-
if (nodeMajorVersion < 12) {
37-
expect(stdout).toContain(
38-
'at Object.<anonymous>.test (__tests__/a-banana.js:1:1)',
39-
);
40-
41-
stdout = stdout.replace(
42-
'at Object.<anonymous>.test (__tests__/a-banana.js:1:1)',
43-
'at Object.<anonymous> (__tests__/a-banana.js:1:1)',
44-
);
45-
}
46-
4733
expect(exitCode).toBe(0);
4834
expect(rest).toMatchSnapshot();
4935
expect(summary).toMatchSnapshot();

e2e/__tests__/detectOpenHandles.ts

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
* LICENSE file in the root directory of this source tree.
66
*/
77

8-
import {onNodeVersions} from '@jest/test-utils';
98
import runJest, {runContinuous} from '../runJest';
109

1110
try {
@@ -81,16 +80,14 @@ it('does not report crypto random data', () => {
8180
expect(textAfterTest).toBe('');
8281
});
8382

84-
onNodeVersions('>=12', () => {
85-
it('does not report ELD histograms', () => {
86-
const {stderr} = runJest('detect-open-handles', [
87-
'histogram',
88-
'--detectOpenHandles',
89-
]);
90-
const textAfterTest = getTextAfterTest(stderr);
83+
it('does not report ELD histograms', () => {
84+
const {stderr} = runJest('detect-open-handles', [
85+
'histogram',
86+
'--detectOpenHandles',
87+
]);
88+
const textAfterTest = getTextAfterTest(stderr);
9189

92-
expect(textAfterTest).toBe('');
93-
});
90+
expect(textAfterTest).toBe('');
9491
});
9592

9693
describe('notify', () => {
@@ -109,17 +106,15 @@ describe('notify', () => {
109106
});
110107
});
111108

112-
onNodeVersions('>=12', () => {
113-
it('does not report timeouts using unref', () => {
114-
// The test here is basically that it exits cleanly without reporting anything (does not need `until`)
115-
const {stderr} = runJest('detect-open-handles', [
116-
'unref',
117-
'--detectOpenHandles',
118-
]);
119-
const textAfterTest = getTextAfterTest(stderr);
109+
it('does not report timeouts using unref', () => {
110+
// The test here is basically that it exits cleanly without reporting anything (does not need `until`)
111+
const {stderr} = runJest('detect-open-handles', [
112+
'unref',
113+
'--detectOpenHandles',
114+
]);
115+
const textAfterTest = getTextAfterTest(stderr);
120116

121-
expect(textAfterTest).toBe('');
122-
});
117+
expect(textAfterTest).toBe('');
123118
});
124119

125120
it('prints out info about open handlers from inside tests', async () => {

e2e/__tests__/errorOnDeprecated.test.ts

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -31,30 +31,14 @@ const SHOULD_NOT_PASS_IN_JEST = new Set([
3131
'spyOnProperty.test.js',
3232
]);
3333

34-
const nodeMajorVersion = Number(process.versions.node.split('.')[0]);
35-
3634
testFiles.forEach(testFile => {
3735
test(`${testFile} errors in errorOnDeprecated mode`, () => {
3836
const result = runJest('error-on-deprecated', [
3937
testFile,
4038
'--errorOnDeprecated',
4139
]);
4240
expect(result.exitCode).toBe(1);
43-
let {rest} = extractSummary(result.stderr);
44-
45-
if (
46-
nodeMajorVersion < 12 &&
47-
testFile === 'defaultTimeoutInterval.test.js'
48-
) {
49-
const lineEntry = '(__tests__/defaultTimeoutInterval.test.js:10:3)';
50-
51-
expect(rest).toContain(`at Object.<anonymous>.test ${lineEntry}`);
52-
53-
rest = rest.replace(
54-
`at Object.<anonymous>.test ${lineEntry}`,
55-
`at Object.<anonymous> ${lineEntry}`,
56-
);
57-
}
41+
const {rest} = extractSummary(result.stderr);
5842

5943
expect(rest).toMatchSnapshot();
6044
});

e2e/__tests__/failures.test.ts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ function cleanStderr(stderr: string) {
2020
.replace(new RegExp('Failed: Object {', 'g'), 'thrown: Object {');
2121
}
2222

23-
const nodeMajorVersion = Number(process.versions.node.split('.')[0]);
24-
2523
beforeAll(() => {
2624
runYarnInstall(dir);
2725
});
@@ -37,18 +35,6 @@ test('not throwing Error objects', () => {
3735
stderr = runJest(dir, ['assertionCount.test.js']).stderr;
3836
expect(cleanStderr(stderr)).toMatchSnapshot();
3937
stderr = runJest(dir, ['duringTests.test.js']).stderr;
40-
41-
if (nodeMajorVersion < 12) {
42-
const lineEntry = '(__tests__/duringTests.test.js:43:8)';
43-
44-
expect(stderr).toContain(`at Object.<anonymous>.done ${lineEntry}`);
45-
46-
stderr = stderr.replace(
47-
`at Object.<anonymous>.done ${lineEntry}`,
48-
`at Object.<anonymous> ${lineEntry}`,
49-
);
50-
}
51-
5238
expect(cleanStderr(stderr)).toMatchSnapshot();
5339
stderr = runJest(dir, ['throwObjectWithStackProp.test.js']).stderr;
5440
expect(cleanStderr(stderr)).toMatchSnapshot();

e2e/__tests__/requireMainAfterCreateRequire.test.ts

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,17 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*/
7+
78
import * as path from 'path';
8-
import {onNodeVersions} from '@jest/test-utils';
99
import runJest from '../runJest';
1010

11-
onNodeVersions('>=12.2.0', () => {
12-
test('`require.main` not undefined after createRequire', () => {
13-
const {stdout} = runJest('require-main-after-create-require');
11+
test('`require.main` not undefined after createRequire', () => {
12+
const {stdout} = runJest('require-main-after-create-require');
1413

15-
expect(stdout).toBe(
16-
path.join(
17-
__dirname,
18-
'../require-main-after-create-require/__tests__/parent.test.js',
19-
),
20-
);
21-
});
14+
expect(stdout).toBe(
15+
path.join(
16+
__dirname,
17+
'../require-main-after-create-require/__tests__/parent.test.js',
18+
),
19+
);
2220
});

0 commit comments

Comments
 (0)