Skip to content

Commit b2383d5

Browse files
chore(tests): Add node 19.x to the test matrix to support the current node version (#551)
* Add node 19.x to the test matrix to support the current node version * fix: test support for node 19 This commit fixes the test support specifically for get-configuration.test.js, because node 19 and up use different Error messages for JSON parsing errors. This commit adds a special case for node 19 and up, changing the expected error message. Signed-off-by: Raphael Höser <[email protected]> * Chore: refactor tests for node 19 support Instead of making an explicit version check, just test for the important part of the error message. * Fix: prettier issues Signed-off-by: Raphael Höser <[email protected]> * Fix: unittest error string for failed audits inputs. Signed-off-by: Raphael Höser <[email protected]> --------- Signed-off-by: Raphael Höser <[email protected]>
1 parent 88e9ec5 commit b2383d5

File tree

4 files changed

+5
-9
lines changed

4 files changed

+5
-9
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
runs-on: ubuntu-latest
1616
strategy:
1717
matrix:
18-
node-version: [14.x, 16.x, 18.x]
18+
node-version: [14.x, 16.x, 18.x, 19.x]
1919

2020
steps:
2121
- uses: actions/checkout@v3

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"puppeteer": "^18.0.0"
3333
},
3434
"engines": {
35-
"node": ">=14.15 <19"
35+
"node": ">=14.15 <20"
3636
},
3737
"type": "module",
3838
"repository": {

src/lib/get-configuration/get-configuration.test.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,7 @@ describe('config', () => {
168168
};
169169

170170
expect(() => getConfiguration({ constants, inputs })).toThrow(
171-
new Error(
172-
`Invalid JSON for 'thresholds' input: Unexpected token i in JSON at position 0`,
173-
),
171+
/Invalid JSON for 'thresholds' input/,
174172
);
175173
});
176174

@@ -182,9 +180,7 @@ describe('config', () => {
182180
};
183181

184182
expect(() => getConfiguration({ constants, inputs })).toThrow(
185-
new Error(
186-
`Invalid JSON for 'audits' input: Unexpected token i in JSON at position 0`,
187-
),
183+
/Invalid JSON for 'audits' input/,
188184
);
189185
});
190186

0 commit comments

Comments
 (0)