isaacs/node-tap — Issue #25: keeps running test function after failed assert
Author: mvolkmann
Created: 2011-12-06 16:13:30+00:00
State: open

tap continues executing the code in a test method after an assert fails. This allows other errors to mask the failed assertion. In the example below, getObj fails to return an object. The assertion t.ok(obj) fails as expected, but execution of the test function continues and we get the following error:
"not ok 3 TypeError: Cannot call method 'someMethod' of undefined".

I think it should stop on the first failed assertion in each test function and report that error. Most other test frameworks work that way and I think that is less confusing.

```
var test = require('tap').test;

function getObj(cb) {
cb(null);
}

test('keeps going', function (t) {
getObj(function (err, obj) {
t.notOk(err);
t.ok(obj);
console.log('obj =', obj);
obj.someMethod();
t.end();
});
});
```