tape-testing / tape

tap-producing test harness for node and browsers
MIT License
5.77k stars 306 forks source link

Not emitting `end` event from stream in plan errors #81

Open azer opened 10 years ago

azer commented 10 years ago

Does tape intentionally not fire end event when there is a plan error?

Example:

var test = require('tape');

test.createStream({ objectMode: true }).on('end', function (){
  console.log('ok');
});

test('fibwibblers and xyrscawlers', function (t) {
  t.plan(3);
  t.ok(false);
});

Won't output "ok"

ljharb commented 4 years ago

This is trivially reproduceable and seems like a clear bug; end should be emitted when there's a plan failure too. I'm unable to quickly come up with a solution, however.