Skip to content

Commit

Permalink
feat(node): drop official support for node 16 (#4542)
Browse files Browse the repository at this point in the history
- Set TS target to es2022 for more concise JavaScript
- Drop support for node 16. The lowest supported version is now NodeJS 18.

BREAKING CHANGE: NodeJS 16 is no longer supported. Please use NodeJS 18 or higher. See https://nodejs.org/en/about/previous-releases
  • Loading branch information
nicojs authored Nov 30, 2023
1 parent c264c15 commit e190207
Show file tree
Hide file tree
Showing 16 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [16.x, 18.x]
node-version: [18.x, 20.x]
os: ['ubuntu-latest', 'windows-latest']
steps:
- uses: actions/checkout@v4
Expand Down
22 changes: 11 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,6 @@
"version": "node tasks/bump-peer-deps.js"
},
"engines": {
"node": ">=16.0.0"
"node": ">=18.0.0"
}
}
2 changes: 1 addition & 1 deletion packages/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
},
"homepage": "https://stryker-mutator.io/",
"engines": {
"node": ">=16.0.0"
"node": ">=18.0.0"
},
"dependencies": {
"mutation-testing-metrics": "3.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"directory": "packages/core"
},
"engines": {
"node": ">=16.0.0"
"node": ">=18.0.0"
},
"keywords": [
"mutation testing",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/test/unit/config/config-reader.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ describe(ConfigReader.name, () => {

// Assert
expect(error).instanceOf(ConfigError);
expect(((error as ConfigError).innerError as Error).message).eq('Unexpected token n in JSON at position 2');
expect(((error as ConfigError).innerError as Error).message).matches(/JSON at position 2/);
});

it('should the final configuration to debug', async () => {
Expand Down
8 changes: 4 additions & 4 deletions packages/core/test/unit/stryker-cli.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,12 @@ describe(StrykerCli.name, () => {

describe(guardMinimalNodeVersion.name, () => {
it('should fail for < v16.0.0', () => {
expect(() => guardMinimalNodeVersion('v14.21.3')).throws(
'Node.js version v14.21.3 detected. StrykerJS requires version to match >=16.0.0. Please update your Node.js version or visit https://nodejs.org/ for additional instructions',
expect(() => guardMinimalNodeVersion('v16.20.2')).throws(
'Node.js version v16.20.2 detected. StrykerJS requires version to match >=18.0.0. Please update your Node.js version or visit https://nodejs.org/ for additional instructions',
);
});
it('should not fail for >= v16.0.0', () => {
expect(() => guardMinimalNodeVersion('v16.0.0')).not.throws();
it('should not fail for >= v18.0.0', () => {
expect(() => guardMinimalNodeVersion('v18.0.0')).not.throws();
});
});

Expand Down
2 changes: 1 addition & 1 deletion packages/cucumber-runner/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"directory": "packages/cucumber-runner"
},
"engines": {
"node": ">=16.0.0"
"node": ">=18.0.0"
},
"keywords": [
"stryker",
Expand Down
2 changes: 1 addition & 1 deletion packages/grunt-stryker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
],
"license": "Apache-2.0",
"engines": {
"node": ">=16.0.0"
"node": ">=18.0.0"
},
"files": [
"tasks"
Expand Down
2 changes: 1 addition & 1 deletion packages/instrumenter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"directory": "packages/instrumenter"
},
"engines": {
"node": ">=16.0.0"
"node": ">=18.0.0"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/jasmine-runner/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
]
},
"engines": {
"node": ">=16.0.0"
"node": ">=18.0.0"
},
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-runner/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"directory": "packages/jest-runner"
},
"engines": {
"node": ">=16.0.0"
"node": ">=18.0.0"
},
"keywords": [
"stryker",
Expand Down
2 changes: 1 addition & 1 deletion packages/karma-runner/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"directory": "packages/karma-runner"
},
"engines": {
"node": ">=16.0.0"
"node": ">=18.0.0"
},
"keywords": [
"stryker",
Expand Down
2 changes: 1 addition & 1 deletion packages/mocha-runner/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"directory": "packages/mocha-runner"
},
"engines": {
"node": ">=16.0.0"
"node": ">=18.0.0"
},
"keywords": [
"stryker",
Expand Down
2 changes: 1 addition & 1 deletion packages/typescript-checker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"directory": "packages/typescript-checker"
},
"engines": {
"node": ">=16.0.0"
"node": ">=18.0.0"
},
"publishConfig": {
"access": "public"
Expand Down
4 changes: 2 additions & 2 deletions tsconfig.settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"compilerOptions": {
"strict": true,
"module": "Node16",
"target": "es2019",
"target": "es2022",
"moduleResolution": "Node16",
"esModuleInterop": true,
"sourceMap": true,
Expand All @@ -19,7 +19,7 @@
"node"
],
"lib": [
"es2021"
"es2022"
]
}
}

0 comments on commit e190207

Please sign in to comment.