Skip to content

Commit b09c92e

Browse files
author
Roald de Vries
committed
add tape.tearDown handler
Fixes #175
1 parent aaea6cf commit b09c92e

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

index.js

+8
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ exports = module.exports = (function () {
3535
}
3636
return harness.createStream(opts);
3737
};
38+
39+
lazyLoad.tearDown = function () {
40+
return getHarness().tearDown.apply(this, arguments);
41+
};
3842

3943
lazyLoad.getHarness = getHarness
4044

@@ -126,6 +130,10 @@ function createHarness (conf_) {
126130
test.createStream = function (opts) {
127131
return results.createStream(opts);
128132
};
133+
134+
test.tearDown = function (cb) {
135+
results.on('done', cb);
136+
};
129137

130138
var only = false;
131139
test.only = function (name) {

test/tearDown.js

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
var tap = require("tap");
2+
var tape = require("../");
3+
4+
tap.test("tear down", {timeout: 1000}, function (tt) {
5+
tt.plan(1);
6+
tape.tearDown(function() {
7+
tt.pass('tape ended');
8+
});
9+
tape('dummy test', function(t) {
10+
t.end();
11+
});
12+
});

0 commit comments

Comments
 (0)