From 14cf2454ae35946e837be4dde4e4c6c9e83f5392 Mon Sep 17 00:00:00 2001 From: David Anson Date: Sat, 1 Mar 2025 19:28:23 -0800 Subject: [PATCH] Make new test further backward-compatible for testing Node versions < 22. --- test/parse-configuration-test.mjs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/parse-configuration-test.mjs b/test/parse-configuration-test.mjs index fa3b6ca03..b4cbffe68 100644 --- a/test/parse-configuration-test.mjs +++ b/test/parse-configuration-test.mjs @@ -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); });