1 | var tap = require("tap");
|
2 | var tape = require("../").createHarness();
|
3 |
|
4 | //Because this test passing depends on a failure,
|
5 | //we must direct the failing output of the inner test
|
6 | var noop = function () {};
|
7 | var mockSink = {on: noop, removeListener: noop, emit: noop, end: noop};
|
8 | tape.createStream().pipe(mockSink);
|
9 |
|
10 | tap.test("on failure", { timeout: 1000 }, function (tt) {
|
11 | tt.plan(1);
|
12 |
|
13 | tape("dummy test", function (t) {
|
14 | t.fail();
|
15 | t.end();
|
16 | });
|
17 |
|
18 | tape.onFailure(function () {
|
19 | tt.pass("tape ended");
|
20 | });
|
21 | });
|