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