UNPKG

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