Skip to content

Commit e917a9a

Browse files
authored
ci: add node v19 (#16443)
Node v19.0.0 has been released. https://nodejs.org/en/blog/release/v19.0.0/ This PR adds the v19 matrix and fixes the following tests failure when using v19.0.0. ```console % node -v v19.0.0 % npx mocha tests/lib/shared/runtime-info.js (snip) 1) RuntimeInfo environment() log and throw an error when checking for local ESLint version when returned output of command is malformed: AssertionError: expected [Function environment] to throw error including 'Unexpected token T in JSON at positio…' but got 'Unexpected token \'T\', "This is not …' + expected - actual -Unexpected token 'T', "This is not JSON" is not valid JSON +Unexpected token T in JSON at position 0 at Context.<anonymous> (tests/lib/shared/runtime-info.js:209:20) at process.processImmediate (node:internal/timers:471:21) 2) RuntimeInfo environment() log and throw an error when checking for global ESLint version when returned output of command is malformed: AssertionError: expected [Function environment] to throw error including 'Unexpected token T in JSON at positio…' but got 'Unexpected token \'T\', "This is not …' + expected - actual -Unexpected token 'T', "This is not JSON" is not valid JSON +Unexpected token T in JSON at position 0 at Context.<anonymous> (tests/lib/shared/runtime-info.js:217:20) at process.processImmediate (node:internal/timers:471:21) ``` This patch uses regexp to match both messages because the message has changed in v19.0.0.
1 parent 740b208 commit e917a9a

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
strategy:
3737
matrix:
3838
os: [ubuntu-latest]
39-
node: [18.x, 17.x, 16.x, 14.x, 12.x, "12.22.0"]
39+
node: [19.x, 18.x, 17.x, 16.x, 14.x, 12.x, "12.22.0"]
4040
include:
4141
- os: windows-latest
4242
node: "16.x"

tests/lib/shared/runtime-info.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,15 +206,15 @@ describe("RuntimeInfo", () => {
206206
spawnSyncStubArgs[2] = "This is not JSON";
207207
setupSpawnSyncStubReturnVals(spawnSyncStub, spawnSyncStubArgs);
208208

209-
assert.throws(RuntimeInfo.environment, "Unexpected token T in JSON at position 0");
209+
assert.throws(RuntimeInfo.environment, /^Unexpected token .*T.* JSON/u);
210210
assert.strictEqual(logErrorStub.args[0][0], "Error finding eslint version running the command `npm ls --depth=0 --json eslint`");
211211
});
212212

213213
it("log and throw an error when checking for global ESLint version when returned output of command is malformed", () => {
214214
spawnSyncStubArgs[4] = "This is not JSON";
215215
setupSpawnSyncStubReturnVals(spawnSyncStub, spawnSyncStubArgs);
216216

217-
assert.throws(RuntimeInfo.environment, "Unexpected token T in JSON at position 0");
217+
assert.throws(RuntimeInfo.environment, /^Unexpected token .*T.* JSON/u);
218218
assert.strictEqual(logErrorStub.args[0][0], "Error finding eslint version running the command `npm ls --depth=0 --json eslint -g`");
219219
});
220220
});

0 commit comments

Comments
 (0)