UNPKG

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