tapjs / tap-parser

parse the test anything protocol
121 stars 35 forks source link

cmd: prevent exiting before stdout flush #76

Closed mdeltito closed 2 years ago

mdeltito commented 3 years ago

Currently the command outputs to stdout by calling console.log(), and if the parsed tap input contains failures it will forcibly exit the process. This can cause the process to exit before the stdout stream is flushed.

Instead of process.exit(1), this sets the exitCode and allows the process to exit gracefully.

Potentially related to #50 and #59

Resolves #77

isaacs commented 2 years ago

Had to do this a little bit differently, or it made some other tests no longer test what they appeared to. It'll work on next release.

mdeltito commented 2 years ago

excellent, thanks @isaacs !