test_runner: bail by marco-ippolito · Pull Request #48919 · nodejs/node
@nodejs/test_runner I think we should decide if we want to support bailing out, and if so, what the experience looks like?
My opinion is that we should support it. This is how I would implement it, but I'm open to input from others:
- If bail out mode is enabled, we emit a
test:bailevent. - Once a failure has occurred, we cancel any remaining tests.
- Probably the step that needs the most discussion: In the built in reporters, we simply exit the process on the
test:bailevent. We should ensure that the failing test is reported, and the TAP reporter should printBail out!. This way we don't need to output a bunch of cancelled tests or worry about the test summary, code coverage, etc. If custom reporters choose not to exit the process, it should be fine because we have made sure the remaining tests are cancelled.
Thoughts?