Skip to content

Commit

Permalink
[Fix] in node v0.4, stream.pipe returns undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed May 13, 2022
1 parent 12cc602 commit 83d4da8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Expand Up @@ -109,7 +109,7 @@ function createExitHarness(conf, wait) {
running = true;
var stream = harness.createStream({ objectMode: config.objectMode });
var es = stream.pipe(config.stream || createDefaultStream());
if (canEmitExit) {
if (canEmitExit && es) { // in node v0.4, `es` is `undefined`
// TODO: use `err` arg?
// eslint-disable-next-line no-unused-vars
es.on('error', function (err) { harness._exitCode = 1; });
Expand Down

0 comments on commit 83d4da8

Please sign in to comment.