Skip to content

Commit 0e03013

Browse files
authored
fix: Update JSON.parse error messages for V8 11.x (#23)
See V8 commits: v8/v8@718f743 v8/v8@a679edb
1 parent e01d8a4 commit 0e03013

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Require/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,12 +238,12 @@ describe("TNS require", function () {
238238

239239
it("should handle JSON file errors", function () {
240240
require('./RequireJsonCorruptFile');
241-
expect(TNSGetOutput()).toMatch(/JSON Parse error: Unterminated string$|Unexpected token/)
241+
expect(TNSGetOutput()).toMatch(/JSON Parse error: Unterminated string$|Unexpected token|Bad control character/);
242242
});
243243

244244
it("shouldn't load invalid JSON file", function () {
245245
require("./RequireJsonCorruptFile1");
246-
expect(TNSGetOutput()).toMatch(/Unexpected token s in JSON at position 1$|JSON Parse error: Unable to parse JSON string$|No identifiers allowed directly after numeric literal$/)
246+
expect(TNSGetOutput()).toMatch(/Unexpected token s in JSON at position 1$|JSON Parse error: Unable to parse JSON string$|No identifiers allowed directly after numeric literal$|Unexpected non-whitespace character/);
247247
});
248248

249249
it("when using global in a module global should be defined", function () {

0 commit comments

Comments
 (0)