Skip to content

Commit d4628a9

Browse files
authored
Merge pull request #310 from secvisogram/278-nodejs-22
Node.js 22 support
2 parents e0bc7c3 + dd74182 commit d4628a9

File tree

3 files changed

+31
-6
lines changed

3 files changed

+31
-6
lines changed

.github/workflows/publish-report.yml

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,24 @@ permissions:
1212
jobs:
1313
report:
1414
runs-on: ubuntu-latest
15+
16+
strategy:
17+
matrix:
18+
19+
#
20+
# The test report is published for every supported nodejs version. But the
21+
# coverage information is reported for the latest nodejs version only. When
22+
# changing this array here make sure to update the latest version below
23+
# (next comment).
24+
#
25+
26+
node-version: [20.x, 22.x]
27+
1528
steps:
1629
- name: Download workflow artifact
1730
uses: actions/download-artifact@v4
1831
with:
19-
name: test-results
32+
name: test-results-${{ matrix.node-version }}
2033
run-id: ${{ github.event.workflow_run.id }}
2134
github-token: ${{ secrets.GITHUB_TOKEN }}
2235
- name: Set pr number env
@@ -27,11 +40,18 @@ jobs:
2740
uses: phoenix-actions/test-reporting@v15
2841
id: test-report
2942
with:
30-
artifact: test-results
31-
name: Mocha Tests
43+
artifact: test-results-${{ matrix.node-version }}
44+
name: Mocha Tests (node v${{ matrix.node-version }})
3245
path: test-results.json
3346
reporter: mocha-json
3447
- name: c8 coverage report
48+
49+
#
50+
# The coverage report is generated for the latest node version only.
51+
# Make sure, to update this when changing the matrix above.
52+
#
53+
54+
if: ${{ matrix.node-version == '22.x' }}
3555
uses: Nef10/lcov-reporter-action@v0.4.0
3656
with:
3757
pr-number: ${{ env.PR_NUMBER }}

.github/workflows/run-tests.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,19 @@ permissions:
99
jobs:
1010
test:
1111
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
node-version: [20.x, 22.x]
16+
1217
steps:
1318
- run: sudo apt-get install hunspell
1419
- uses: actions/checkout@v4
1520
with:
1621
submodules: recursive
1722
- uses: actions/setup-node@v4
1823
with:
19-
node-version: 20
24+
node-version: ${{ matrix.node-version }}
2025
- run: npm ci
2126
- run: npm run test-report
2227
- run: npm run test-coverage-lcov
@@ -28,7 +33,7 @@ jobs:
2833
- uses: actions/upload-artifact@v4
2934
if: success() || failure()
3035
with:
31-
name: test-results
36+
name: test-results-${{ matrix.node-version }}
3237
path: |
3338
test-results.json
3439
coverage

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ export const weaknesses: Array<{ id: string; name: string }>
547547
548548
## Testing
549549
550-
Tests are implemented using [mocha](https://mochajs.org/). The minimal supported Node.js version is **14**. They can be run using the following command:
550+
Tests are implemented using [mocha](https://mochajs.org/). The minimal supported Node.js version is **20**. They can be run using the following command:
551551
552552
```sh
553553
npm test

0 commit comments

Comments
 (0)