UNPKG

543 BJavaScriptView Raw
1var tap = require("tap");
2var tape = require("../").createHarness();
3
4//Because this test passing depends on a failure,
5//we must direct the failing output of the inner test
6var noop = function () {};
7var mockSink = {on: noop, removeListener: noop, emit: noop, end: noop};
8tape.createStream().pipe(mockSink);
9
10tap.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});