[Pkg-javascript-devel] Bug#1072600: node-json-parse-better-errors: FTBFS: failing tests
Santiago Vila
sanvila at debian.org
Wed Jun 5 01:17:18 BST 2024
Package: src:node-json-parse-better-errors
Version: 1.0.2+~cs3.3.1-2
Severity: serious
Tags: ftbfs
Dear maintainer:
During a rebuild of all packages in unstable, your package failed to build:
--------------------------------------------------------------------------------
[...]
debian/rules binary
dh binary
dh_update_autotools_config
dh_autoreconf
dh_auto_configure --buildsystem=nodejs
Link node_modules/json-parse-even-better-errors -> ../json-parse-even-better-errors
Link node_modules/@types/json-parse-better-errors -> ../../types-json-parse-better-errors
dh_auto_build --buildsystem=nodejs
No build command found, searching known files
No build command found, searching known files
No build command found, searching known files
dh_auto_test --buildsystem=nodejs
ln -s ../. node_modules/json-parse-better-errors
cd ./json-parse-even-better-errors && sh -ex ../debian/nodejs/json-parse-even-better-errors/test
+ tap -J test/index.js
TAP version 13
(node:186126) DeprecationWarning: deepEqual() is deprecated, use same() instead
(Use `node --trace-deprecation ...` to show where the warning was created)
(node:186126) DeprecationWarning: isa() is deprecated, use type() instead
# Subtest: test/index.js
# Subtest: parses JSON
1..6
ok 1 - object
ok 2 - array
ok 3 - num
ok 4 - null
ok 5 - true
ok 6 - false
ok 1 - parses JSON # time=9.314ms
# Subtest: preserves indentation and newline styles
# Subtest: {"type":"object","newline":"\\n","indent":""}
ok 1 - preserved newline
ok 2 - preserved indent
1..2
ok 1 - {"type":"object","newline":"\\n","indent":""} # time=1.422ms
# Subtest: {"type":"array","newline":"\\n","indent":""}
ok 1 - preserved newline
ok 2 - preserved indent
1..2
ok 2 - {"type":"array","newline":"\\n","indent":""} # time=1.275ms
# Subtest: {"type":"object","newline":"\\n","indent":" "}
ok 1 - preserved newline
ok 2 - preserved indent
1..2
ok 3 - {"type":"object","newline":"\\n","indent":" "} # time=0.879ms
# Subtest: {"type":"array","newline":"\\n","indent":" "}
ok 1 - preserved newline
ok 2 - preserved indent
1..2
ok 4 - {"type":"array","newline":"\\n","indent":" "} # time=0.873ms
# Subtest: {"type":"object","newline":"\\n","indent":"\\t"}
ok 1 - preserved newline
ok 2 - preserved indent
1..2
ok 5 - {"type":"object","newline":"\\n","indent":"\\t"} # time=0.72ms
# Subtest: {"type":"array","newline":"\\n","indent":"\\t"}
ok 1 - preserved newline
ok 2 - preserved indent
1..2
ok 6 - {"type":"array","newline":"\\n","indent":"\\t"} # time=0.697ms
# Subtest: {"type":"object","newline":"\\n","indent":" \\t \\t "}
ok 1 - preserved newline
ok 2 - preserved indent
1..2
ok 7 - {"type":"object","newline":"\\n","indent":" \\t \\t "} # time=0.591ms
# Subtest: {"type":"array","newline":"\\n","indent":" \\t \\t "}
ok 1 - preserved newline
ok 2 - preserved indent
1..2
ok 8 - {"type":"array","newline":"\\n","indent":" \\t \\t "} # time=0.574ms
# Subtest: {"type":"object","newline":"\\r\\n","indent":""}
ok 1 - preserved newline
ok 2 - preserved indent
1..2
ok 9 - {"type":"object","newline":"\\r\\n","indent":""} # time=0.509ms
# Subtest: {"type":"array","newline":"\\r\\n","indent":""}
ok 1 - preserved newline
ok 2 - preserved indent
1..2
ok 10 - {"type":"array","newline":"\\r\\n","indent":""} # time=0.553ms
# Subtest: {"type":"object","newline":"\\r\\n","indent":" "}
ok 1 - preserved newline
ok 2 - preserved indent
1..2
ok 11 - {"type":"object","newline":"\\r\\n","indent":" "} # time=0.501ms
# Subtest: {"type":"array","newline":"\\r\\n","indent":" "}
ok 1 - preserved newline
ok 2 - preserved indent
1..2
ok 12 - {"type":"array","newline":"\\r\\n","indent":" "} # time=0.495ms
# Subtest: {"type":"object","newline":"\\r\\n","indent":"\\t"}
ok 1 - preserved newline
ok 2 - preserved indent
1..2
ok 13 - {"type":"object","newline":"\\r\\n","indent":"\\t"} # time=0.51ms
# Subtest: {"type":"array","newline":"\\r\\n","indent":"\\t"}
ok 1 - preserved newline
ok 2 - preserved indent
1..2
ok 14 - {"type":"array","newline":"\\r\\n","indent":"\\t"} # time=0.666ms
# Subtest: {"type":"object","newline":"\\r\\n","indent":" \\t \\t "}
ok 1 - preserved newline
ok 2 - preserved indent
1..2
ok 15 - {"type":"object","newline":"\\r\\n","indent":" \\t \\t "} # time=0.589ms
# Subtest: {"type":"array","newline":"\\r\\n","indent":" \\t \\t "}
ok 1 - preserved newline
ok 2 - preserved indent
1..2
ok 16 - {"type":"array","newline":"\\r\\n","indent":" \\t \\t "} # time=0.5ms
# Subtest: {"type":"object","newline":"\\n\\n","indent":""}
ok 1 - preserved newline
ok 2 - preserved indent
1..2
ok 17 - {"type":"object","newline":"\\n\\n","indent":""} # time=0.515ms
# Subtest: {"type":"array","newline":"\\n\\n","indent":""}
ok 1 - preserved newline
ok 2 - preserved indent
1..2
ok 18 - {"type":"array","newline":"\\n\\n","indent":""} # time=0.498ms
# Subtest: {"type":"object","newline":"\\n\\n","indent":" "}
ok 1 - preserved newline
ok 2 - preserved indent
1..2
ok 19 - {"type":"object","newline":"\\n\\n","indent":" "} # time=0.487ms
# Subtest: {"type":"array","newline":"\\n\\n","indent":" "}
ok 1 - preserved newline
ok 2 - preserved indent
1..2
ok 20 - {"type":"array","newline":"\\n\\n","indent":" "} # time=0.524ms
# Subtest: {"type":"object","newline":"\\n\\n","indent":"\\t"}
ok 1 - preserved newline
ok 2 - preserved indent
1..2
ok 21 - {"type":"object","newline":"\\n\\n","indent":"\\t"} # time=0.52ms
# Subtest: {"type":"array","newline":"\\n\\n","indent":"\\t"}
ok 1 - preserved newline
ok 2 - preserved indent
1..2
ok 22 - {"type":"array","newline":"\\n\\n","indent":"\\t"} # time=0.492ms
# Subtest: {"type":"object","newline":"\\n\\n","indent":" \\t \\t "}
ok 1 - preserved newline
ok 2 - preserved indent
1..2
ok 23 - {"type":"object","newline":"\\n\\n","indent":" \\t \\t "} # time=0.501ms
# Subtest: {"type":"array","newline":"\\n\\n","indent":" \\t \\t "}
ok 1 - preserved newline
ok 2 - preserved indent
1..2
ok 24 - {"type":"array","newline":"\\n\\n","indent":" \\t \\t "} # time=0.487ms
# Subtest: {"type":"object","newline":"\\r\\n\\r\\n","indent":""}
ok 1 - preserved newline
ok 2 - preserved indent
1..2
ok 25 - {"type":"object","newline":"\\r\\n\\r\\n","indent":""} # time=0.459ms
# Subtest: {"type":"array","newline":"\\r\\n\\r\\n","indent":""}
ok 1 - preserved newline
ok 2 - preserved indent
1..2
ok 26 - {"type":"array","newline":"\\r\\n\\r\\n","indent":""} # time=0.434ms
# Subtest: {"type":"object","newline":"\\r\\n\\r\\n","indent":" "}
ok 1 - preserved newline
ok 2 - preserved indent
1..2
ok 27 - {"type":"object","newline":"\\r\\n\\r\\n","indent":" "} # time=0.51ms
# Subtest: {"type":"array","newline":"\\r\\n\\r\\n","indent":" "}
ok 1 - preserved newline
ok 2 - preserved indent
1..2
ok 28 - {"type":"array","newline":"\\r\\n\\r\\n","indent":" "} # time=0.424ms
# Subtest: {"type":"object","newline":"\\r\\n\\r\\n","indent":"\\t"}
ok 1 - preserved newline
ok 2 - preserved indent
1..2
ok 29 - {"type":"object","newline":"\\r\\n\\r\\n","indent":"\\t"} # time=0.409ms
# Subtest: {"type":"array","newline":"\\r\\n\\r\\n","indent":"\\t"}
ok 1 - preserved newline
ok 2 - preserved indent
1..2
ok 30 - {"type":"array","newline":"\\r\\n\\r\\n","indent":"\\t"} # time=0.421ms
# Subtest: {"type":"object","newline":"\\r\\n\\r\\n","indent":" \\t \\t "}
ok 1 - preserved newline
ok 2 - preserved indent
1..2
ok 31 - {"type":"object","newline":"\\r\\n\\r\\n","indent":" \\t \\t "} # time=0.427ms
# Subtest: {"type":"array","newline":"\\r\\n\\r\\n","indent":" \\t \\t "}
ok 1 - preserved newline
ok 2 - preserved indent
1..2
ok 32 - {"type":"array","newline":"\\r\\n\\r\\n","indent":" \\t \\t "} # time=0.494ms
1..32
ok 2 - preserves indentation and newline styles # time=80.769ms
# Subtest: indentation is the default when object/array is empty
# Subtest: {"str":"{}","newline":"","expect":"\\n"}
ok 1 - got expected newline
ok 2 - got expected default indentation
1..2
ok 1 - {"str":"{}","newline":"","expect":"\\n"} # time=0.548ms
# Subtest: {"str":"[]","newline":"","expect":"\\n"}
ok 1 - got expected newline
ok 2 - got expected default indentation
1..2
ok 2 - {"str":"[]","newline":"","expect":"\\n"} # time=0.407ms
# Subtest: {"str":"{}","newline":"\\n","expect":"\\n"}
ok 1 - got expected newline
ok 2 - got expected default indentation
1..2
ok 3 - {"str":"{}","newline":"\\n","expect":"\\n"} # time=0.429ms
# Subtest: {"str":"[]","newline":"\\n","expect":"\\n"}
ok 1 - got expected newline
ok 2 - got expected default indentation
1..2
ok 4 - {"str":"[]","newline":"\\n","expect":"\\n"} # time=0.408ms
# Subtest: {"str":"{}","newline":"\\r\\n","expect":"\\r\\n"}
ok 1 - got expected newline
ok 2 - got expected default indentation
1..2
ok 5 - {"str":"{}","newline":"\\r\\n","expect":"\\r\\n"} # time=0.418ms
# Subtest: {"str":"[]","newline":"\\r\\n","expect":"\\r\\n"}
ok 1 - got expected newline
ok 2 - got expected default indentation
1..2
ok 6 - {"str":"[]","newline":"\\r\\n","expect":"\\r\\n"} # time=0.441ms
# Subtest: {"str":"{}","newline":"\\n\\n","expect":"\\n\\n"}
ok 1 - got expected newline
ok 2 - got expected default indentation
1..2
ok 7 - {"str":"{}","newline":"\\n\\n","expect":"\\n\\n"} # time=0.402ms
# Subtest: {"str":"[]","newline":"\\n\\n","expect":"\\n\\n"}
ok 1 - got expected newline
ok 2 - got expected default indentation
1..2
ok 8 - {"str":"[]","newline":"\\n\\n","expect":"\\n\\n"} # time=0.416ms
# Subtest: {"str":"{}","newline":"\\r\\n\\r\\n","expect":"\\r\\n\\r\\n"}
ok 1 - got expected newline
ok 2 - got expected default indentation
1..2
ok 9 - {"str":"{}","newline":"\\r\\n\\r\\n","expect":"\\r\\n\\r\\n"} # time=0.413ms
# Subtest: {"str":"[]","newline":"\\r\\n\\r\\n","expect":"\\r\\n\\r\\n"}
ok 1 - got expected newline
ok 2 - got expected default indentation
1..2
ok 10 - {"str":"[]","newline":"\\r\\n\\r\\n","expect":"\\r\\n\\r\\n"} # time=0.43ms
1..10
ok 3 - indentation is the default when object/array is empty # time=19.028ms
# Subtest: parses JSON if it is a Buffer, removing BOM bytes
ok 1 - should be equivalent
ok 2 - strips the byte order marker
1..2
ok 4 - parses JSON if it is a Buffer, removing BOM bytes # time=1.314ms
# Subtest: better errors when faced with \\b and other malarky
not ok 1 - only strips a single BOM, not multiple
---
diff: >
--- expected
+++ actual
@@ -1,3 +1,6 @@
-Object {
- "message": /\(0xFEFF\) in JSON at position 0/,
+JSONParseError: Unexpected token '', "{"foo":1,"... is not valid JSON while parsing '{"foo":1,"bar":{"baz":[1,2,3,"four"]}}' {
+ "position": 0,
+ "code": "EJSONPARSE",
+ "systemError": SyntaxError: Unexpected token '', "{"foo":1,"... is not valid JSON,
+ "name": "JSONParseError",
}
pattern:
message: !re /\(0xFEFF\) in JSON at position 0/
at:
line: 92
column: 5
file: test/index.js
type: Test
stack: |
Test.<anonymous> (test/index.js:92:5)
Test.cb (/usr/share/nodejs/libtap/lib/test.js:127:40)
/usr/share/nodejs/libtap/lib/test.js:369:21
Test.main (/usr/share/nodejs/libtap/lib/test.js:376:7)
Test.runMain (/usr/share/nodejs/libtap/lib/base.js:178:15)
/usr/share/nodejs/libtap/lib/test.js:490:13
TAP.writeSubComment (/usr/share/nodejs/libtap/lib/test.js:561:5)
Test.<anonymous> (/usr/share/nodejs/libtap/lib/test.js:489:14)
loop (/usr/share/nodejs/function-loop/index.js:19:13)
TAP.runBeforeEach (/usr/share/nodejs/libtap/lib/test.js:898:7)
TAP.processSubtest (/usr/share/nodejs/libtap/lib/test.js:488:12)
TAP.process (/usr/share/nodejs/libtap/lib/test.js:405:14)
TAP.sub (/usr/share/nodejs/libtap/lib/test.js:234:10)
TAP.test (/usr/share/nodejs/libtap/lib/test.js:258:17)
Object.<anonymous> (test/index.js:83:3)
Module.replacementCompile (/usr/share/nodejs/append-transform/index.js:60:13)
Object.<anonymous> (/usr/share/nodejs/append-transform/index.js:64:4)
source: >2
const bombom = Buffer.concat([Buffer.from([0xEF, 0xBB, 0xBF, 0xEF, 0xBB, 0xBF]), data])
t.throws(() => parseJson(bombom), {
----^
message: /\(0xFEFF\) in JSON at position 0/
}, 'only strips a single BOM, not multiple')
...
not ok 2 - expected to throw
---
diff: "--- expected
+++ actual
@@ -1,3 +1,6 @@
-Object {
- \"message\": /^Unexpected token \"\\\\b\" \\(0x08\\) in JSON at
position.*\\\\b\"$/,
+JSONParseError: Unexpected non-whitespace character after JSON at position
38 while parsing '{\"foo\":1,\"bar\":{\"baz\":[1,2,3,\"four\"]}}\b\b' {
+ \"position\": 0,
+ \"code\": \"EJSONPARSE\",
+ \"systemError\": SyntaxError: Unexpected non-whitespace character after
JSON at position 38,
+ \"name\": \"JSONParseError\",
\ }\n"
pattern:
message: !re /^Unexpected token "\\b" \(0x08\) in JSON at position.*\\b"$/
at:
line: 96
column: 5
file: test/index.js
type: Test
stack: |
Test.<anonymous> (test/index.js:96:5)
Test.cb (/usr/share/nodejs/libtap/lib/test.js:127:40)
/usr/share/nodejs/libtap/lib/test.js:369:21
Test.main (/usr/share/nodejs/libtap/lib/test.js:376:7)
Test.runMain (/usr/share/nodejs/libtap/lib/base.js:178:15)
/usr/share/nodejs/libtap/lib/test.js:490:13
TAP.writeSubComment (/usr/share/nodejs/libtap/lib/test.js:561:5)
Test.<anonymous> (/usr/share/nodejs/libtap/lib/test.js:489:14)
loop (/usr/share/nodejs/function-loop/index.js:19:13)
TAP.runBeforeEach (/usr/share/nodejs/libtap/lib/test.js:898:7)
TAP.processSubtest (/usr/share/nodejs/libtap/lib/test.js:488:12)
TAP.process (/usr/share/nodejs/libtap/lib/test.js:405:14)
TAP.sub (/usr/share/nodejs/libtap/lib/test.js:234:10)
TAP.test (/usr/share/nodejs/libtap/lib/test.js:258:17)
Object.<anonymous> (test/index.js:83:3)
Module.replacementCompile (/usr/share/nodejs/append-transform/index.js:60:13)
Object.<anonymous> (/usr/share/nodejs/append-transform/index.js:64:4)
source: |2
const bs = str + '\b\b\b\b\b\b\b\b\b\b\b\b'
t.throws(() => parseJson(bs), {
----^
message: /^Unexpected token "\\b" \(0x08\) in JSON at position.*\\b"$/
})
...
1..2
# failed 2 of 2 tests
not ok 5 - better errors when faced with \\b and other malarky # time=35.709ms
# Subtest: throws SyntaxError for unexpected token
not ok 1 - expected to throw
---
diff: >
--- expected
+++ actual
@@ -1,7 +1,6 @@
-Object {
- "message": "Unexpected token \"o\" (0x6F) in JSON at position 1 while parsing \"foo\"",
+JSONParseError: Unexpected token 'o', "foo" is not valid JSON while parsing 'foo' {
+ "position": 0,
"code": "EJSONPARSE",
- "position": 1,
+ "systemError": SyntaxError: Unexpected token 'o', "foo" is not valid JSON,
"name": "JSONParseError",
- "systemError": Function SyntaxError(),
}
pattern:
message: Unexpected token "o" (0x6F) in JSON at position 1 while parsing "foo"
code: EJSONPARSE
position: 1
name: JSONParseError
systemError: !function |-
"SyntaxError"
function SyntaxError() { [native code] }
at:
line: 104
column: 5
file: test/index.js
type: Test
stack: |
Test.<anonymous> (test/index.js:104:5)
Test.cb (/usr/share/nodejs/libtap/lib/test.js:127:40)
/usr/share/nodejs/libtap/lib/test.js:369:21
Test.main (/usr/share/nodejs/libtap/lib/test.js:376:7)
Test.runMain (/usr/share/nodejs/libtap/lib/base.js:178:15)
/usr/share/nodejs/libtap/lib/test.js:490:13
TAP.writeSubComment (/usr/share/nodejs/libtap/lib/test.js:561:5)
Test.<anonymous> (/usr/share/nodejs/libtap/lib/test.js:489:14)
loop (/usr/share/nodejs/function-loop/index.js:19:13)
TAP.runBeforeEach (/usr/share/nodejs/libtap/lib/test.js:898:7)
TAP.processSubtest (/usr/share/nodejs/libtap/lib/test.js:488:12)
TAP.process (/usr/share/nodejs/libtap/lib/test.js:405:14)
TAP.sub (/usr/share/nodejs/libtap/lib/test.js:234:10)
TAP.test (/usr/share/nodejs/libtap/lib/test.js:258:17)
Object.<anonymous> (test/index.js:102:3)
Module.replacementCompile (/usr/share/nodejs/append-transform/index.js:60:13)
Object.<anonymous> (/usr/share/nodejs/append-transform/index.js:64:4)
source: |2
const data = 'foo'
t.throws(
----^
() => parseJson(data),
{
...
1..1
# failed 1 test
not ok 6 - throws SyntaxError for unexpected token # time=12.974ms
# Subtest: throws SyntaxError for unexpected end of JSON
not ok 1 - expected to throw
---
diff: >
--- expected
+++ actual
@@ -1,7 +1,6 @@
-Object {
- "message": "Unexpected end of JSON input while parsing \"{\\\"foo: bar}\"",
+JSONParseError: Unterminated string in JSON at position 11 while parsing '{"foo: bar}' {
+ "position": 0,
"code": "EJSONPARSE",
- "position": 10,
+ "systemError": SyntaxError: Unterminated string in JSON at position 11,
"name": "JSONParseError",
- "systemError": Function SyntaxError(),
}
pattern:
message: 'Unexpected end of JSON input while parsing "{\"foo: bar}"'
code: EJSONPARSE
position: 10
name: JSONParseError
systemError: !function |-
"SyntaxError"
function SyntaxError() { [native code] }
at:
line: 119
column: 5
file: test/index.js
type: Test
stack: |
Test.<anonymous> (test/index.js:119:5)
Test.cb (/usr/share/nodejs/libtap/lib/test.js:127:40)
/usr/share/nodejs/libtap/lib/test.js:369:21
Test.main (/usr/share/nodejs/libtap/lib/test.js:376:7)
Test.runMain (/usr/share/nodejs/libtap/lib/base.js:178:15)
/usr/share/nodejs/libtap/lib/test.js:490:13
TAP.writeSubComment (/usr/share/nodejs/libtap/lib/test.js:561:5)
Test.<anonymous> (/usr/share/nodejs/libtap/lib/test.js:489:14)
loop (/usr/share/nodejs/function-loop/index.js:19:13)
TAP.runBeforeEach (/usr/share/nodejs/libtap/lib/test.js:898:7)
TAP.processSubtest (/usr/share/nodejs/libtap/lib/test.js:488:12)
TAP.process (/usr/share/nodejs/libtap/lib/test.js:405:14)
TAP.sub (/usr/share/nodejs/libtap/lib/test.js:234:10)
TAP.test (/usr/share/nodejs/libtap/lib/test.js:258:17)
Object.<anonymous> (test/index.js:117:3)
Module.replacementCompile (/usr/share/nodejs/append-transform/index.js:60:13)
Object.<anonymous> (/usr/share/nodejs/append-transform/index.js:64:4)
source: |2
const data = '{"foo: bar}'
t.throws(
----^
() => parseJson(data),
{
...
1..1
# failed 1 test
not ok 7 - throws SyntaxError for unexpected end of JSON # time=6.859ms
# Subtest: throws SyntaxError for unexpected number
not ok 1 - expected to throw
---
diff: >
--- expected
+++ actual
@@ -1,7 +1,6 @@
-Object {
- "message": "Unexpected number in JSON at position 8",
+JSONParseError: Expected property name or '}' in JSON at position 8 while parsing '[[1,2],{3,3,3,3,3}]' {
+ "position": 0,
"code": "EJSONPARSE",
- "position": 0,
+ "systemError": SyntaxError: Expected property name or '}' in JSON at position 8,
"name": "JSONParseError",
- "systemError": Function SyntaxError(),
}
pattern:
message: Unexpected number in JSON at position 8
code: EJSONPARSE
position: 0
name: JSONParseError
systemError: !function |-
"SyntaxError"
function SyntaxError() { [native code] }
at:
line: 134
column: 5
file: test/index.js
type: Test
stack: |
Test.<anonymous> (test/index.js:134:5)
Test.cb (/usr/share/nodejs/libtap/lib/test.js:127:40)
/usr/share/nodejs/libtap/lib/test.js:369:21
Test.main (/usr/share/nodejs/libtap/lib/test.js:376:7)
Test.runMain (/usr/share/nodejs/libtap/lib/base.js:178:15)
/usr/share/nodejs/libtap/lib/test.js:490:13
TAP.writeSubComment (/usr/share/nodejs/libtap/lib/test.js:561:5)
Test.<anonymous> (/usr/share/nodejs/libtap/lib/test.js:489:14)
loop (/usr/share/nodejs/function-loop/index.js:19:13)
TAP.runBeforeEach (/usr/share/nodejs/libtap/lib/test.js:898:7)
TAP.processSubtest (/usr/share/nodejs/libtap/lib/test.js:488:12)
TAP.process (/usr/share/nodejs/libtap/lib/test.js:405:14)
TAP.sub (/usr/share/nodejs/libtap/lib/test.js:234:10)
TAP.test (/usr/share/nodejs/libtap/lib/test.js:258:17)
Object.<anonymous> (test/index.js:132:3)
Module.replacementCompile (/usr/share/nodejs/append-transform/index.js:60:13)
Object.<anonymous> (/usr/share/nodejs/append-transform/index.js:64:4)
source: |2
const data = '[[1,2],{3,3,3,3,3}]'
t.throws(
----^
() => parseJson(data),
{
...
1..1
# failed 1 test
not ok 8 - throws SyntaxError for unexpected number # time=6.286ms
# Subtest: SyntaxError with less context (limited start)
not ok 1 - expected to throw
---
diff: >
--- expected
+++ actual
@@ -1,7 +1,6 @@
-Object {
- "message": "Unexpected end of JSON input while parsing near \"...3210\"",
+JSONParseError: Unterminated string in JSON at position 9 while parsing '{"6543' {
+ "position": 0,
"code": "EJSONPARSE",
- "position": 8,
+ "systemError": SyntaxError: Unterminated string in JSON at position 9,
"name": "JSONParseError",
- "systemError": Function SyntaxError(),
}
pattern:
message: Unexpected end of JSON input while parsing near "...3210"
code: EJSONPARSE
position: 8
name: JSONParseError
systemError: !function |-
"SyntaxError"
function SyntaxError() { [native code] }
at:
line: 149
column: 5
file: test/index.js
type: Test
stack: |
Test.<anonymous> (test/index.js:149:5)
Test.cb (/usr/share/nodejs/libtap/lib/test.js:127:40)
/usr/share/nodejs/libtap/lib/test.js:369:21
Test.main (/usr/share/nodejs/libtap/lib/test.js:376:7)
Test.runMain (/usr/share/nodejs/libtap/lib/base.js:178:15)
/usr/share/nodejs/libtap/lib/test.js:490:13
TAP.writeSubComment (/usr/share/nodejs/libtap/lib/test.js:561:5)
Test.<anonymous> (/usr/share/nodejs/libtap/lib/test.js:489:14)
loop (/usr/share/nodejs/function-loop/index.js:19:13)
TAP.runBeforeEach (/usr/share/nodejs/libtap/lib/test.js:898:7)
TAP.processSubtest (/usr/share/nodejs/libtap/lib/test.js:488:12)
TAP.process (/usr/share/nodejs/libtap/lib/test.js:405:14)
TAP.sub (/usr/share/nodejs/libtap/lib/test.js:234:10)
TAP.test (/usr/share/nodejs/libtap/lib/test.js:258:17)
Object.<anonymous> (test/index.js:147:3)
Module.replacementCompile (/usr/share/nodejs/append-transform/index.js:60:13)
Object.<anonymous> (/usr/share/nodejs/append-transform/index.js:64:4)
source: |2
const data = '{"6543210'
t.throws(
----^
() => parseJson(data, null, 3),
{
...
1..1
# failed 1 test
not ok 9 - SyntaxError with less context (limited start) # time=6.142ms
# Subtest: SyntaxError with less context (limited end)
not ok 1 - expected to throw
---
diff: >
--- expected
+++ actual
@@ -1,7 +1,6 @@
-Object {
- "message": "Unexpected token \"a\" (0x61) in JSON at position 0 while parsing near \"ab...\"",
+JSONParseError: Unexpected token 'a', "abcde" is not valid JSON while parsing 'abcd' {
+ "position": 0,
"code": "EJSONPARSE",
- "position": 0,
+ "systemError": SyntaxError: Unexpected token 'a', "abcde" is not valid JSON,
"name": "JSONParseError",
- "systemError": Function SyntaxError(),
}
pattern:
message: Unexpected token "a" (0x61) in JSON at position 0 while parsing near "ab..."
code: EJSONPARSE
position: 0
name: JSONParseError
systemError: !function |-
"SyntaxError"
function SyntaxError() { [native code] }
at:
line: 163
column: 5
file: test/index.js
type: Test
stack: |
Test.<anonymous> (test/index.js:163:5)
Test.cb (/usr/share/nodejs/libtap/lib/test.js:127:40)
/usr/share/nodejs/libtap/lib/test.js:369:21
Test.main (/usr/share/nodejs/libtap/lib/test.js:376:7)
Test.runMain (/usr/share/nodejs/libtap/lib/base.js:178:15)
/usr/share/nodejs/libtap/lib/test.js:490:13
TAP.writeSubComment (/usr/share/nodejs/libtap/lib/test.js:561:5)
Test.<anonymous> (/usr/share/nodejs/libtap/lib/test.js:489:14)
loop (/usr/share/nodejs/function-loop/index.js:19:13)
TAP.runBeforeEach (/usr/share/nodejs/libtap/lib/test.js:898:7)
TAP.processSubtest (/usr/share/nodejs/libtap/lib/test.js:488:12)
TAP.process (/usr/share/nodejs/libtap/lib/test.js:405:14)
TAP.sub (/usr/share/nodejs/libtap/lib/test.js:234:10)
TAP.test (/usr/share/nodejs/libtap/lib/test.js:258:17)
Object.<anonymous> (test/index.js:161:3)
Module.replacementCompile (/usr/share/nodejs/append-transform/index.js:60:13)
Object.<anonymous> (/usr/share/nodejs/append-transform/index.js:64:4)
source: |2
const data = 'abcde'
t.throws(
----^
() => parseJson(data, null, 2),
{
...
1..1
# failed 1 test
not ok 10 - SyntaxError with less context (limited end) # time=5.321ms
# Subtest: throws TypeError for undefined
ok 1 - expected to throw: TypeError Cannot parse undefined
1..1
ok 11 - throws TypeError for undefined # time=0.89ms
# Subtest: throws TypeError for non-strings
ok 1 - expected to throw: TypeError Cannot parse [object Map]
1..1
ok 12 - throws TypeError for non-strings # time=0.578ms
# Subtest: throws TypeError for empty arrays
ok 1 - expected to throw: TypeError Cannot parse an empty array
1..1
ok 13 - throws TypeError for empty arrays # time=0.524ms
# Subtest: handles empty string helpfully
ok 1 - expected to throw
1..1
ok 14 - handles empty string helpfully # time=0.968ms
# Subtest: json parse error class
ok 1 - type is function
ok 2 - gets the original error attached
ok 3 - should be equal
ok 4 - should be equal
ok 5 - should be equal
ok 6 - should be equal
ok 7 - should not match pattern provided
ok 8 - gets the original error attached
ok 9 - should be equal
ok 10 - should be equal
ok 11 - should match pattern provided
1..11
ok 15 - json parse error class # time=4.217ms
# Subtest: parse without exception
ok 1 - does not throw
ok 2 - parses json string
ok 3 - parses json buffer
ok 4 - parses json buffer with bom
1..4
ok 16 - parse without exception # time=1.219ms
1..16
# failed 6 of 16 tests
# time=234.605ms
not ok 1 - test/index.js # time=234.605ms
---
env: {}
file: test/index.js
timeout: 30000
command: /usr/bin/node
args:
- test/index.js
stdio:
- 0
- pipe
- 2
cwd: /<<PKGBUILDDIR>>/json-parse-even-better-errors
exitCode: 1
...
1..1
# failed 1 test
# time=962.883ms
ERROR: Coverage for lines (85.71%) does not meet global threshold (100%)
ERROR: Coverage for functions (88.88%) does not meet global threshold (100%)
ERROR: Coverage for branches (63.82%) does not meet global threshold (100%)
ERROR: Coverage for statements (86%) does not meet global threshold (100%)
----------|---------|----------|---------|---------|-------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
----------|---------|----------|---------|---------|-------------------
All files | 86 | 63.82 | 88.88 | 85.71 |
index.js | 86 | 63.82 | 88.88 | 85.71 | 4-5,26-38
----------|---------|----------|---------|---------|-------------------
dh_auto_test: error: cd ./json-parse-even-better-errors && sh -ex ../debian/nodejs/json-parse-even-better-errors/test returned exit code 1
make: *** [debian/rules:8: binary] Error 25
dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2
--------------------------------------------------------------------------------
The above is just how the build ends and not necessarily the most relevant part.
If required, the full build log is available here:
https://people.debian.org/~sanvila/build-logs/202406/
About the archive rebuild: The build was made on virtual machines
of type m6a.large and r6a.large from AWS, using sbuild and a
reduced chroot with only build-essential packages.
If you could not reproduce the bug please contact me privately, as I
am willing to provide ssh access to a virtual machine where the bug is
fully reproducible.
If this is really a bug in one of the build-depends, please use
reassign and affects, so that this is still visible in the BTS web
page for this package.
Thanks.
More information about the Pkg-javascript-devel
mailing list