Skip to content

Commit

Permalink
throw test passes
Browse files Browse the repository at this point in the history
  • Loading branch information
James Halliday committed Dec 4, 2012
1 parent c8e11e1 commit 37f79d2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
9 changes: 7 additions & 2 deletions lib/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,15 @@ function Test (name_, opts_, cb_) {

Test.prototype.run = function () {
if (this._skip) {
this.end();
} else {
return this.end();
}
try {
this._cb(this);
}
catch (err) {
this.error(err);
this.end();
}
};

Test.prototype.test = function (name, opts, cb) {
Expand Down
10 changes: 5 additions & 5 deletions test/throw.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var tap = require('tap');
tap.test('throw test', function (tt) {
tt.plan(1);

var test = tape.createHarness();
var test = tape.createHarness({ exit : false });
var tc = tap.createConsumer();

var rows = [];
Expand All @@ -20,11 +20,11 @@ tap.test('throw test', function (tt) {
tt.same(rs, [
'TAP version 13',
'thrower',
{ id: 1, ok: true, name: 'should be equivalent' },
{ id: 2, ok: false, name: 'Error: rawr' },
{ id: 1, ok: true, name: 'should be equal' },
{ id: 2, ok: false, name: 'rawr' },
'tests 2',
'pass 1',
'fail 1',
'pass 1',
'fail 1',
]);
});

Expand Down

0 comments on commit 37f79d2

Please sign in to comment.