Skip to content

Commit

Permalink
add tape.tearDown handler
Browse files Browse the repository at this point in the history
Fixes #175
  • Loading branch information
Roald de Vries committed Nov 13, 2015
1 parent aaea6cf commit b09c92e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
8 changes: 8 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ exports = module.exports = (function () {
}
return harness.createStream(opts);
};

lazyLoad.tearDown = function () {
return getHarness().tearDown.apply(this, arguments);
};

lazyLoad.getHarness = getHarness

Expand Down Expand Up @@ -126,6 +130,10 @@ function createHarness (conf_) {
test.createStream = function (opts) {
return results.createStream(opts);
};

test.tearDown = function (cb) {
results.on('done', cb);
};

var only = false;
test.only = function (name) {
Expand Down
12 changes: 12 additions & 0 deletions test/tearDown.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
var tap = require("tap");
var tape = require("../");

tap.test("tear down", {timeout: 1000}, function (tt) {
tt.plan(1);
tape.tearDown(function() {
tt.pass('tape ended');
});
tape('dummy test', function(t) {
t.end();
});
});

0 comments on commit b09c92e

Please sign in to comment.