Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: refresh Node.js versions support #2331

Merged
merged 13 commits into from
Oct 7, 2023
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- ubuntu-latest
- windows-latest
# these versions must be kept in sync with enginesTested.node in package.json
node-version: [14.x, 16.x, 18.x, 19.x]
node-version: [18.x, 20.x]
fail-fast: false

steps:
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
Please see [CONTRIBUTING.md](./CONTRIBUTING.md) on how to contribute to Cucumber.

## [Unreleased]
### Added
- Add support for Node.js 20 ([#2331](https://github.com/cucumber/cucumber-js/pull/2331))

### Removed
- BREAKING CHANGE: Drop support for Node.js 14, 16 and 19 ([#2331](https://github.com/cucumber/cucumber-js/pull/2331))

## [9.6.0] - 2023-10-07
### Fixed
Expand Down
12 changes: 11 additions & 1 deletion features/stack_traces.feature
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,18 @@ Feature: Stack traces
"""
And it fails

@esm
Scenario: esm
Given my env includes "{\"NODE_OPTIONS\":\"--loader ts-node/esm\"}"
Given a file named "tsconfig.json" with:
"""
{
"compilerOptions": {
"module": "esnext",
"moduleResolution": "nodenext"
}
}
"""
Given my env includes "{\"NODE_OPTIONS\":\"--loader ts-node/esm --enable-source-maps\"}"
When I run cucumber-js with `--import features/steps.ts`
Then the output contains the text:
"""
Expand Down
10 changes: 5 additions & 5 deletions package-lock.json

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

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,10 @@
},
"types": "./lib/index.d.ts",
"engines": {
"node": "14 || 16 || >=18"
"node": "18 || >=20"
},
"enginesTested": {
"node": "14 || 16 || 18 || 19"
"node": "18 || 20"
},
"dependencies": {
"@cucumber/ci-environment": "9.2.0",
Expand Down Expand Up @@ -268,7 +268,7 @@
"@types/mocha": "10.0.1",
"@types/mustache": "4.2.2",
"@types/mz": "2.7.4",
"@types/node": "18.11.18",
"@types/node": "20.8.3",
"@types/progress": "2.0.5",
"@types/semver": "7.5.0",
"@types/sinon-chai": "3.2.9",
Expand Down
6 changes: 4 additions & 2 deletions src/api/console_logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ import { Writable } from 'stream'
import { ILogger } from '../logger'

export class ConsoleLogger implements ILogger {
private console: Console = new Console(this.stream)
constructor(private stream: Writable, private debugEnabled: boolean) {}
private console: Console
constructor(private stream: Writable, private debugEnabled: boolean) {
this.console = new Console(this.stream)
}

debug(...content: any[]): void {
if (this.debugEnabled) {
Expand Down
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"compilerOptions": {
"esModuleInterop": true,
"lib": ["es2019"],
"lib": ["es2022"],
"module": "commonjs",
"noImplicitAny": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"resolveJsonModule": true,
"sourceMap": true,
"inlineSources": true,
"target": "es2018",
"target": "es2022",
"typeRoots": ["./node_modules/@types", "./src/types"],
"paths": {
"@sinonjs/fake-timers": ["./node_modules/@types/sinonjs__fake-timers"]
Expand Down