Skip to content

Commit

Permalink
Make new test backward-compatible for testing Node versions < 22.
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidAnson committed Mar 2, 2025
1 parent 63147ee commit a5e2134
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/parse-configuration-test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,12 @@ 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 (line 1 column 2)"
"message": "Unable to parse 'name'; Parser 0: Expected property name or '}' in JSON at position 1"
};
// Backwards-compatibility for testing Node versions < 22
if (actual.message) {
actual.message = actual.message.replace(" (line 1 column 2)", "");
}
t.deepEqual(actual, expected);
});

Expand Down

0 comments on commit a5e2134

Please sign in to comment.