UNPKG

1.16 kBJavaScriptView Raw
1'use strict';
2
3var tap = require('tap');
4var tape = require('../');
5var concat = require('concat-stream');
6
7var common = require('./common');
8var stripFullStack = common.stripFullStack;
9
10tap.test('tape todo test', function (assert) {
11 var test = tape.createHarness({ exit: false });
12 assert.plan(1);
13
14 test.createStream().pipe(concat(function (body) {
15 assert.equal(
16 stripFullStack(body.toString('utf8')),
17 'TAP version 13\n'
18 + '# success\n'
19 + 'ok 1 this test runs\n'
20 + '# TODO failure\n'
21 + 'not ok 2 should never happen # TODO\n'
22 + ' ---\n'
23 + ' operator: fail\n'
24 + ' at: Test.<anonymous> ($TEST/todo.js:$LINE:$COL)\n'
25 + ' ...\n'
26 + '\n'
27 + '1..2\n'
28 + '# tests 2\n'
29 + '# pass 2\n'
30 + '\n'
31 + '# ok\n'
32 );
33 }));
34
35 test('success', function (t) {
36 t.equal(true, true, 'this test runs');
37 t.end();
38 });
39
40 test('failure', { todo: true }, function (t) {
41 t.fail('should never happen');
42 t.end();
43 });
44});