UNPKG

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