mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-16 14:00:13 +01:00
Make new test backward-compatible for testing Node versions < 22.
This commit is contained in:
parent
63147ee1eb
commit
a5e2134147
1 changed files with 5 additions and 1 deletions
|
|
@ -31,8 +31,12 @@ test("invalid json, default parser", (t) => {
|
||||||
const actual = parseConfiguration("name", "{");
|
const actual = parseConfiguration("name", "{");
|
||||||
const expected = {
|
const expected = {
|
||||||
"config": null,
|
"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);
|
t.deepEqual(actual, expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue