1 | 'use strict';
|
2 |
|
3 | var tap = require('tap');
|
4 | var tape = require('../');
|
5 | var concat = require('concat-stream');
|
6 |
|
7 | var common = require('./common');
|
8 | var stripFullStack = common.stripFullStack;
|
9 |
|
10 | tap.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.deepEqual(stripFullStack(body.toString('utf8')), [
|
16 | 'TAP version 13',
|
17 | '# success',
|
18 | 'ok 1 this test runs',
|
19 | '# TODO incomplete test1',
|
20 | 'not ok 2 check output # TODO',
|
21 | ' ---',
|
22 | ' operator: equal',
|
23 | ' expected: false',
|
24 | ' actual: true',
|
25 | ' at: Test.<anonymous> ($TEST/todo_explanation.js:$LINE:$COL)',
|
26 | ' ...',
|
27 | 'not ok 3 check vars output # TODO name conflict',
|
28 | ' ---',
|
29 | ' operator: equal',
|
30 | ' expected: 0',
|
31 | ' actual: 1',
|
32 | ' at: Test.<anonymous> ($TEST/todo_explanation.js:$LINE:$COL)',
|
33 | ' ...',
|
34 | '# incomplete test2',
|
35 | 'not ok 4 run openssl # TODO installer needs fix',
|
36 | ' ---',
|
37 | ' operator: fail',
|
38 | ' at: Test.<anonymous> ($TEST/todo_explanation.js:$LINE:$COL)',
|
39 | ' ...',
|
40 | '# TODO passing test',
|
41 | '',
|
42 | '1..4',
|
43 | '# tests 4',
|
44 | '# pass 4',
|
45 | '',
|
46 | '# ok',
|
47 | ''
|
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 | });
|