Open MadLittleMods opened 8 years ago
fixed in latest tape-run, can you give it a try?
It is much better now with tape-run@2.1.4
but not perfect.
It shows the following error after the normal output which I am guessing is something going awry with the stdout pipe or something and doesn't exit the electron process although easily exit-able in the dock now.
stream.js:74
throw er; // Unhandled stream error in pipe.
^
Error: write EPIPE
at exports._errnoException (util.js:870:11)
at WriteWrap.afterWrite (net.js:769:14)
the EPIPE error indeed comes from the closed stdio, and it's node's way of exiting the problem in this case of node a.js | some-program
. And since it goes to stderr, tap-bail
also can't catch it.
There is however a way to fix this: Redirect your program's stderr to stdout, like so:
$ npm test 2>&1 | tap-bail
This way the output's end looks like this:
# a single time
not ok 41 (unnamed assert)
---
operator: notOk
$
I'm looking into electron not closing properly
If my PR is accepted for epipebomb, you could use the cli to suppress EPIPE. https://github.com/mhart/epipebomb/pull/7
epipebomb "tape-run etc" | tap-bail
As of epipebomb@1.0.0
, you can do either of these to suppress the EPIPE error.
node -r epipebomb/register node_modules/tape/bin/tape build/**/*.test.js | tap-bail
epipebomb node_modules/tape/bin/tape build/**/*.test.js | tap-bail
This may be more an issue with
tape-run
or electron but just wanted to note thattap-bail
messes with running tests withtape-run
.Trying
tap-bail
with https://github.com/bevacqua/dragulanpm test | tap-bail
results in a never-ending javascript error window (keeps re-appearing after pressing ok). This can only be stopped byps | grep electron
and killing the process.