-
-
Notifications
You must be signed in to change notification settings - Fork 365
Open
Description
I have a script that blocks the event loop and is run with a timeout:
// in loop.js
while(true) {}
$ timeout -s KILL 2s node loop.js
nyc reports zero coverage when the node process is killed, when in this case it should be 100%.
$ npx nyc timeout -s KILL 2s node loop.js
----------|---------|----------|---------|---------|-------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
----------|---------|----------|---------|---------|-------------------
All files | 0 | 0 | 0 | 0 |
----------|---------|----------|---------|---------|-------------------
Also noticed that if sending a SIGTERM as timeout does by default, the node process doesn't terminate.
$ timeout 2s node loop.js # this terminates
$ npx nyc timeout 2s node loop.js # this doesn't terminate
Version Info
- nyc 17.1.0
- node 22.12.0
- npx 11.2.0
Metadata
Metadata
Assignees
Labels
No labels