invalid location in tap reported when there is something that keep the tests from exiting and run global timeout reached #49926
Closed
Description
opened on Sep 28, 2023
Version
20.7.0
Platform
Darwin Razs-MacBook-Pro.local 23.0.0 Darwin Kernel Version 23.0.0: Fri Sep 15 14:41:43 PDT 2023; root:xnu-10002.1.13~1/RELEASE_ARM64_T6000 arm64
Subsystem
test_runner
What steps will reproduce the bug?
- clone https://github.com/rluvaton/tap-reporter-have-invalid-location-when-failed-on-before-hook-timeout
- run
npm test
How often does it reproduce? Is there a required condition?
the test runner should stop the tests when there is something that keeps it running
What is the expected behavior? Why is that the expected behavior?
to not see undefined:undefined:undefined
in the location
What do you see instead?
$ node ./run-tests.js
TAP version 13
# Subtest: should work
ok 1 - should work
---
duration_ms: 1.079375
...
# Subtest: ./a.test.js
not ok 1 - ./a.test.js
---
duration_ms: 5001.997458
location: 'undefined:undefined:undefined' <--------------- invalid
failureType: 'testTimeoutFailure'
error: 'test timed out after 5000ms'
code: 'ERR_TEST_FAILURE'
stack: |-
async Promise.allSettled (index 0)
...
1..2
# tests 2
# suites 0
# pass 1
# fail 0
# cancelled 1
# skipped 0
# todo 0
# duration_ms 5006.3885
Process finished with exit code 0
Additional information
No response
Activity