UNPKG

2.32 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', { todo: process.versions.node.match(/0\.8\.\d+/) ? 'Fails on node 0.8': false }, 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',
16 '# success',
17 'ok 1 this test runs',
18 '# TODO incomplete test1',
19 'not ok 2 check output # TODO',
20 ' ---',
21 ' operator: equal',
22 ' expected: false',
23 ' actual: true',
24 ' at: Test.<anonymous> ($TEST/todo_explanation.js:$LINE:$COL)',
25 ' ...',
26 'not ok 3 check vars output # TODO name conflict',
27 ' ---',
28 ' operator: equal',
29 ' expected: 0',
30 ' actual: 1',
31 ' at: Test.<anonymous> ($TEST/todo_explanation.js:$LINE:$COL)',
32 ' ...',
33 '# incomplete test2',
34 'not ok 4 run openssl # TODO installer needs fix',
35 ' ---',
36 ' operator: fail',
37 ' at: Test.<anonymous> ($TEST/todo_explanation.js:$LINE:$COL)',
38 ' ...',
39 '# TODO passing test',
40 '',
41 '1..4',
42 '# tests 4',
43 '# pass 4',
44 '',
45 '# ok',
46 ''
47 ].join('\n')
48 );
49 }));
50
51 test('success', function (t) {
52 t.equal(true, true, 'this test runs');
53 t.end();
54 });
55
56 test('incomplete test1', { todo: true }, function (t) {
57 t.equal(true, false, 'check output');
58 t.equal(1, 0, 'check vars output', { todo: 'name conflict' });
59 t.end();
60 });
61
62 test('incomplete test2', function (t) {
63 t.fail('run openssl', { todo: 'installer needs fix' });
64 t.end();
65 });
66
67 test('passing test', { todo: 'yet incomplete' }, function (t) {
68 t.end();
69 });
70});