Skip to content

Commit

Permalink
Make new test further backward-compatible for testing Node versions <…
Browse files Browse the repository at this point in the history
… 22.
  • Loading branch information
DavidAnson committed Mar 2, 2025
1 parent a5e2134 commit 14cf245
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/parse-configuration-test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ test("invalid json, default parser", (t) => {
const actual = parseConfiguration("name", "{");
const expected = {
"config": null,
"message": "Unable to parse 'name'; Parser 0: Expected property name or '}' in JSON at position 1"
"message": "Unable to parse 'name'; Parser 0: ..."
};
// Backwards-compatibility for testing Node versions < 22
if (actual.message) {
actual.message = actual.message.replace(" (line 1 column 2)", "");
actual.message = actual.message.replace(/Parser 0: .*$/, "Parser 0: ...");
}
t.deepEqual(actual, expected);
});
Expand Down

0 comments on commit 14cf245

Please sign in to comment.