Skip to content

Commit acb2c2b

Browse files
committed
ci: run tests on earlier versions
1 parent 80d53c7 commit acb2c2b

8 files changed

Lines changed: 17 additions & 5 deletions

File tree

.github/workflows/ci-build.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,12 @@ jobs:
6161
npm run build --workspace=@slack/socket-mode
6262
- name: Lint
6363
run: npm run lint
64-
- name: Run tests
64+
- name: Run tests (Node 18)
65+
if: matrix.node-version == '18.x'
66+
# Node 18 doesn't have --test-reporter=lcov/junit, use simpler test script
67+
run: npm run test:node18 --workspaces --if-present
68+
- name: Run tests (Node 20+)
69+
if: matrix.node-version != '18.x'
6570
run: npm test
6671
- name: Upload code coverage
6772
if: matrix.node-version == '22.x' && matrix.os == 'ubuntu-latest'

packages/cli-hooks/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
"build": "shx chmod +x src/*.js",
3939
"prelint": "tsc --noemit --module es2022 --maxNodeModuleJsDepth 0 --project ./jsconfig.json",
4040
"test": "npm run test:unit",
41+
"test:node18": "node --test --test-reporter=spec --test src/*.test.js",
4142
"test:unit": "node --experimental-test-coverage --test-reporter=spec --test-reporter-destination=stdout --test-reporter=lcov --test-reporter-destination=lcov.info --test-reporter=junit --test-reporter-destination=test-results.xml --test src/*.test.js"
4243
},
4344
"bin": {

packages/cli-test/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@
3333
"docs": "npx typedoc --plugin typedoc-plugin-markdown",
3434
"prepack": "npm run build",
3535
"test": "npm run test:unit",
36-
"test:unit": "npm run build && SLACK_CLI_PATH=/doesnt/matter node --experimental-test-coverage --test-reporter=spec --test-reporter-destination=stdout --test-reporter=lcov --test-reporter-destination=lcov.info --test-reporter=junit --test-reporter-destination=test-results.xml --import tsx --test 'src/**/*.test.ts'"
36+
"test:node18": "npm run build && cross-env SLACK_CLI_PATH=/doesnt/matter node --test --test-reporter=spec --import tsx --test src/**/*.test.ts",
37+
"test:unit": "npm run build && cross-env SLACK_CLI_PATH=/doesnt/matter node --experimental-test-coverage --test-reporter=spec --test-reporter-destination=stdout --test-reporter=lcov --test-reporter-destination=lcov.info --test-reporter=junit --test-reporter-destination=test-results.xml --import tsx --test src/**/*.test.ts"
3738
},
3839
"dependencies": {
3940
"tree-kill": "^1.2.2",

packages/logger/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
"docs": "npx typedoc --plugin typedoc-plugin-markdown",
3535
"prepack": "npm run build",
3636
"test": "npm run test:unit",
37+
"test:node18": "npm run build && node --test --test-reporter=spec --import tsx --test src/index.test.ts",
3738
"test:unit": "npm run build && node --experimental-test-coverage --test-reporter=spec --test-reporter-destination=stdout --test-reporter=lcov --test-reporter-destination=lcov.info --test-reporter=junit --test-reporter-destination=test-results.xml --import tsx --test src/index.test.ts"
3839
},
3940
"dependencies": {

packages/oauth/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@
3636
"docs": "npx typedoc --plugin typedoc-plugin-markdown",
3737
"prepack": "npm run build",
3838
"test": "npm run test:unit",
39-
"test:unit": "npm run build && node --experimental-test-coverage --test-reporter=spec --test-reporter-destination=stdout --test-reporter=lcov --test-reporter-destination=lcov.info --test-reporter=junit --test-reporter-destination=test-results.xml --import tsx --test 'src/**/*.test.ts'",
39+
"test:node18": "npm run build && node --test --test-reporter=spec --import tsx --test src/**/*.test.ts",
40+
"test:unit": "npm run build && node --experimental-test-coverage --test-reporter=spec --test-reporter-destination=stdout --test-reporter=lcov --test-reporter-destination=lcov.info --test-reporter=junit --test-reporter-destination=test-results.xml --import tsx --test src/**/*.test.ts",
4041
"watch": "npx nodemon --watch 'src' --ext 'ts' --exec npm run build"
4142
},
4243
"dependencies": {

packages/socket-mode/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,9 @@
4444
"docs": "npx typedoc --plugin typedoc-plugin-markdown",
4545
"prepack": "npm run build",
4646
"test": "npm run test:unit && npm run test:integration",
47+
"test:node18": "npm run build && node --test --test-reporter=spec --import tsx --test src/**/*.test.ts && npm run test:integration",
4748
"test:integration": "npm run build && node --import tsx --test test/integration.test.js",
48-
"test:unit": "npm run build && node --experimental-test-coverage --test-reporter=spec --test-reporter-destination=stdout --test-reporter=lcov --test-reporter-destination=lcov.info --test-reporter=junit --test-reporter-destination=test-results.xml --import tsx --test 'src/**/*.test.ts'",
49+
"test:unit": "npm run build && node --experimental-test-coverage --test-reporter=spec --test-reporter-destination=stdout --test-reporter=lcov --test-reporter-destination=lcov.info --test-reporter=junit --test-reporter-destination=test-results.xml --import tsx --test src/**/*.test.ts",
4950
"watch": "npx nodemon --watch 'src' --ext 'ts' --exec npm test"
5051
},
5152
"dependencies": {

packages/web-api/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,11 @@
4141
"docs": "npx typedoc --plugin typedoc-plugin-markdown",
4242
"prepack": "npm run build",
4343
"test": "npm run test:unit",
44+
"test:node18": "npm run build && node --test --test-reporter=spec --import tsx --test src/**/*.test.ts",
4445
"test:integration": "npm run build && node test/integration/commonjs-project/index.js && node test/integration/esm-project/index.mjs && npm run test:integration:ts",
4546
"test:integration:ts": "cd test/integration/ts-4.7-project && npm i && npm run build",
4647
"test:types": "tsd",
47-
"test:unit": "npm run build && node --experimental-test-coverage --test-reporter=spec --test-reporter-destination=stdout --test-reporter=lcov --test-reporter-destination=lcov.info --test-reporter=junit --test-reporter-destination=test-results.xml --import tsx --test 'src/**/*.test.ts'",
48+
"test:unit": "npm run build && node --experimental-test-coverage --test-reporter=spec --test-reporter-destination=stdout --test-reporter=lcov --test-reporter-destination=lcov.info --test-reporter=junit --test-reporter-destination=test-results.xml --import tsx --test src/**/*.test.ts",
4849
"watch": "npx nodemon --watch 'src' --ext 'ts' --exec npm run build"
4950
},
5051
"dependencies": {

packages/webhook/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
"docs": "npx typedoc --plugin typedoc-plugin-markdown",
3939
"prepack": "npm run build",
4040
"test": "npm run test:unit",
41+
"test:node18": "npm run build && node --test --test-reporter=spec --import tsx --test src/IncomingWebhook.test.ts",
4142
"test:unit": "npm run build && node --experimental-test-coverage --test-reporter=spec --test-reporter-destination=stdout --test-reporter=lcov --test-reporter-destination=lcov.info --test-reporter=junit --test-reporter-destination=test-results.xml --import tsx --test src/IncomingWebhook.test.ts"
4243
},
4344
"dependencies": {

0 commit comments

Comments
 (0)