From 71c193e5817d01254a177997c7eb4e61221a260c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Sat, 18 Jun 2022 09:02:31 +0200 Subject: [PATCH] test: adapt to new JSON SyntaxError messages Refs: https://chromium-review.googlesource.com/c/v8/v8/+/3513684 PR-URL: https://github.com/nodejs/node/pull/44741 Reviewed-By: Ben Noordhuis Reviewed-By: Jiawen Geng Reviewed-By: James M Snell --- test/es-module/test-esm-data-urls.js | 2 +- test/es-module/test-esm-invalid-pjson.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/test/es-module/test-esm-data-urls.js b/test/es-module/test-esm-data-urls.js index 5be45d0f7af3b6..7ba7c5f4fb1088 100644 --- a/test/es-module/test-esm-data-urls.js +++ b/test/es-module/test-esm-data-urls.js @@ -76,7 +76,7 @@ function createBase64URL(mime, body) { import('data:application/json;foo="test,",0', { assert: { type: 'json' } }), { name: 'SyntaxError', - message: /Unexpected end of JSON input/ + message: /Unterminated string in JSON at position 3/ }); } { diff --git a/test/es-module/test-esm-invalid-pjson.js b/test/es-module/test-esm-invalid-pjson.js index f3a38018637aa3..9b49f6f1357685 100644 --- a/test/es-module/test-esm-invalid-pjson.js +++ b/test/es-module/test-esm-invalid-pjson.js @@ -18,7 +18,8 @@ describe('ESM: Package.json', { concurrency: true }, () => { stderr.includes( `[ERR_INVALID_PACKAGE_CONFIG]: Invalid package config ${invalidJson} ` + `while importing "invalid-pjson" from ${entry}. ` + - `Unexpected token } in JSON at position ${12 + checkoutEOL.length * 2}` + "Expected ':' after property name in JSON at position " + + `${12 + checkoutEOL.length * 2}` ), stderr );