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