Skip to content
Snippets Groups Projects
Commit e81f2de8 authored by Yadd's avatar Yadd
Browse files

Fix test for nodejs 20

Closes: #1072602
parent 3a5f0849
No related branches found
No related tags found
No related merge requests found
Description: fix test for nodejs 20
Error strings changed
Author: Yadd <yadd@debian.org>
Bug-Debian: https://bugs.debian.org/1072602
Forwarded: not-needed
Last-Update: 2024-06-10
--- a/test.js
+++ b/test.js
@@ -1,8 +1,6 @@
const test = require('tape')
const parseJson = require('.');
-const jsonErrorRegex = /Unexpected token "?}"?.*in foo\.json/;
-
test('main', t => {
t.ok(parseJson('{"foo": true}'));
@@ -19,11 +17,11 @@
error.fileName = 'foo.json';
throw error;
}
- }, jsonErrorRegex);
+ });
t.throws(() => {
parseJson('{\n\t"foo": true,\n}', 'foo.json');
- }, jsonErrorRegex);
+ });
t.throws(() => {
try {
@@ -32,7 +30,7 @@
error.fileName = 'foo.json';
throw error;
}
- }, jsonErrorRegex);
+ });
t.end();
});
......@@ -3,3 +3,4 @@ export-cjs.patch
fix-lines-and-columns-import.patch
switch-test-to-tape.diff
fix-version.patch
fix-for-nodejs-20.patch
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment