mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-16 14:00:13 +01:00
Make new test further backward-compatible for testing Node versions < 22.
This commit is contained in:
parent
a5e2134147
commit
14cf2454ae
1 changed files with 2 additions and 2 deletions
|
|
@ -31,11 +31,11 @@ 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"
|
"message": "Unable to parse 'name'; Parser 0: ..."
|
||||||
};
|
};
|
||||||
// Backwards-compatibility for testing Node versions < 22
|
// Backwards-compatibility for testing Node versions < 22
|
||||||
if (actual.message) {
|
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);
|
t.deepEqual(actual, expected);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue