Skip to content

Commit

Permalink
build!: upgrade to Node.js 20 (#234)
Browse files Browse the repository at this point in the history
* build: upgrade to Node.js 20

* use require to include package.json

* bump cucumber test packages

* bump packages

* update cucumber related packages

* rebase main

* what about this one?

* Revert "what about this one?"

This reverts commit bcdcfba.

* Disable cucumber local test and try to refresh npm cache

* keep cucumber in 9.6.0

* remove slack notification in sauce config

* cleanup test code
  • Loading branch information
tianfeng92 authored Oct 18, 2023
1 parent bde42ab commit aed27f3
Show file tree
Hide file tree
Showing 21 changed files with 4,710 additions and 25,058 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
node-version-file: '.nvmrc'
cache: 'npm'

- name: Install dependencies
- name: Install Dependencies
run: npm ci

- name: Unit Test
Expand Down Expand Up @@ -72,10 +72,9 @@ jobs:
node-version-file: '.nvmrc'
cache: 'npm'

- name: Install dependencies
- name: Install Dependencies
run: |
npm ci
npm i @cucumber/cucumber
npx playwright install
npx playwright install-deps
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v18
v20
19,057 changes: 3,484 additions & 15,573 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"devDependencies": {
"@babel/core": "^7.19.3",
"@babel/preset-env": "^7.19.4",
"@tsconfig/node18": "1.0.1",
"@tsconfig/node20": "20.1.2",
"@types/jest": "^29.1.2",
"@types/lodash": "4.14.194",
"@types/node": "^18.15.7",
Expand Down
2 changes: 1 addition & 1 deletion src/cucumber-runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function buildArgs(runCfg: CucumberRunnerConfig, cucumberBin: string) {
const procArgs = [
cucumberBin,
...paths,
'--publish-quiet',
'--publish-quiet', // Deprecated in 9.4.0. Will be removed in 11.0.0 or later.
'--force-exit',
'--require-module', 'ts-node/register',
'--format', '@saucelabs/cucumber-reporter',
Expand Down
4 changes: 3 additions & 1 deletion src/playwright-runner.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env node
/* eslint-disable @typescript-eslint/no-explicit-any */
import {spawn} from 'node:child_process';
import * as path from 'node:path';
import * as fs from 'node:fs';
Expand Down Expand Up @@ -162,7 +163,8 @@ async function getCfg(runCfgPath: string, suiteName: string): Promise<RunnerConf
async function run(nodeBin: string, runCfgPath: string, suiteName: string) {
const runCfg = await getCfg(runCfgPath, suiteName);

const packageInfo = await import(path.join(__dirname, '..', 'package.json'));
// eslint-disable-next-line @typescript-eslint/no-var-requires
const packageInfo = require(path.join(__dirname, '..', 'package.json'));
console.log(`Sauce Playwright Runner ${packageInfo.version}`);
console.log(`Running Playwright ${packageInfo.dependencies?.playwright || ''}`);

Expand Down
5 changes: 0 additions & 5 deletions tests/fixtures/cloud/.sauce/config-sc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,3 @@ suites:
browserName: "webkit"
testMatch:
- "tests/.*.test.js"

notifications:
slack:
channels: ["devx-slack-notifications"]
send: fail
6 changes: 0 additions & 6 deletions tests/fixtures/cloud/.sauce/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,3 @@ suites:
browserName: "webkit"
testMatch:
- "tests/no-sc/.*.test.js"

notifications:
slack:
channels: ["devx-slack-notifications"]
send: fail

5 changes: 0 additions & 5 deletions tests/fixtures/cloud/cucumber/.sauce/config_mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ suites:
format:
- "json:my-cucumber.json"

notifications:
slack:
channels: ["devx-slack-notifications"]
send: fail

npm:
dependencies:
- "@cucumber/cucumber"
Expand Down
5 changes: 0 additions & 5 deletions tests/fixtures/cloud/cucumber/.sauce/config_win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,6 @@ suites:
format:
- "json:my-cucumber.json"

notifications:
slack:
channels: ["devx-slack-notifications"]
send: fail

npm:
dependencies:
- "@cucumber/cucumber"
Expand Down
Loading

0 comments on commit aed27f3

Please sign in to comment.