UNPKG

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