Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34.3k
Closed
Labels
test_runnerIssues and PRs related to the test runner subsystem.Issues and PRs related to the test runner subsystem.
Description
Version
19.2.0
Platform
Darwin Victors-MacBook-Pro.local 22.2.0 Darwin Kernel Version 22.2.0: Fri Nov 11 02:08:47 PST 2022; root:xnu-8792.61.2~4/RELEASE_X86_64 x86_64
Subsystem
test runner
How to reproduce
Considering a file test.txt is available in the current directory, then the following script does not work anymore starting from 19.2.0 (it crashed on byteLength access):
const{ readFile }=require("node:fs/promises");const{ test }=require("node:test");test("test",async()=>{constbuffer=awaitreadFile("./test.txt");console.log(buffer);console.log(buffer.byteLength);});Works in 19.1.0:
> nodenv shell 19.1.0 && node -v && node --test main.js v19.1.0 TAP version 13 # Subtest: [redacted]/tmp/main.js ok 1 - [redacted]/main.js --- duration_ms: 86.154689 ... 1..1 # tests 1 # pass 1 # fail 0 # cancelled 0 # skipped 0 # todo 0 # duration_ms 89.07115 Does not work in 19.2.0:
> nodenv shell 19.2.0 && node -v && node --test main.js v19.2.0 TAP version 13 # Subtest: [redacted]/tmp/main.js # <Buffer > not ok 1 - [redacted]/tmp/main.js --- duration_ms: 69.710577 failureType: 'uncaughtException' error: "Cannot read properties of undefined (reading 'value')" code: 'ERR_TEST_FAILURE' stack: |- #Plan (node:internal/test_runner/tap_parser:647:20) #TAPDocument (node:internal/test_runner/tap_parser:546:28) #parseChunk (node:internal/test_runner/tap_parser:268:35) #parseTokens (node:internal/test_runner/tap_parser:243:23) TapParser.parse (node:internal/test_runner/tap_parser:103:24) TapParser._transform (node:internal/test_runner/tap_parser:181:10) Transform._write (node:internal/streams/transform:175:8) writeOrBuffer (node:internal/streams/writable:392:12) _write (node:internal/streams/writable:333:10) Writable.write (node:internal/streams/writable:337:10) ... 1..1 # tests 1 # pass 0 # fail 1 # cancelled 0 # skipped 0 # todo 0 # duration_ms 75.363203 It does not work with the latest available version (19.6.0)
v19.6.0 TAP version 13 # Subtest: [redacted]/tmp/main.js # <Buffer > not ok 1 - [redacted]/tmp/main.js --- duration_ms: 62.524259 failureType: 'uncaughtException' error: "Cannot read properties of undefined (reading 'value')" code: 'ERR_TEST_FAILURE' stack: |- #Plan (node:internal/test_runner/tap_parser:651:20) #TAPDocument (node:internal/test_runner/tap_parser:550:28) #parseChunk (node:internal/test_runner/tap_parser:274:35) #parseTokens (node:internal/test_runner/tap_parser:249:23) TapParser.parse (node:internal/test_runner/tap_parser:105:24) TapParser._transform (node:internal/test_runner/tap_parser:187:10) Transform._write (node:internal/streams/transform:175:8) writeOrBuffer (node:internal/streams/writable:392:12) _write (node:internal/streams/writable:333:10) Writable.write (node:internal/streams/writable:337:10) ... 1..1 # tests 1 # pass 0 # fail 1 # cancelled 0 # skipped 0 # todo 0 # duration_ms 71.162296 Additional information
The following script works with all tested version (19.1.0, 19.2.0 & 19.6.0) when not using the --test flag:
const{ readFile }=require("node:fs/promises");(async()=>{constbuffer=awaitreadFile("./test.txt");console.log(buffer);console.log(buffer.byteLength);})()Metadata
Metadata
Assignees
Labels
test_runnerIssues and PRs related to the test runner subsystem.Issues and PRs related to the test runner subsystem.