-
-
Notifications
You must be signed in to change notification settings - Fork 306
/
Copy pathskip.js
69 lines (58 loc) · 1.46 KB
/
skip.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
var test = require('../');
var ran = 0;
var concat = require('concat-stream');
var tap = require('tap');
tap.test('test SKIP comment', function (assert) {
assert.plan(1);
var verify = function (output) {
assert.equal(output.toString('utf8'), [
'TAP version 13',
'# SKIP skipped',
'',
'1..0',
'# tests 0',
'# pass 0',
'',
'# ok',
''
].join('\n'));
};
var tapeTest = test.createHarness();
tapeTest.createStream().pipe(concat(verify));
tapeTest('skipped', { skip: true }, function (t) {
t.end();
});
});
test('do not skip this', { skip: false }, function(t) {
t.pass('this should run');
ran ++;
t.end();
});
test('skip this', { skip: true }, function(t) {
t.fail('this should not even run');
ran++;
t.end();
});
test.skip('skip this too', function(t) {
t.fail('this should not even run');
ran++;
t.end();
});
test('skip subtest', function(t) {
ran ++;
t.test('do not skip this', { skip: false }, function(t) {
ran ++;
t.pass('this should run');
t.end();
});
t.test('skip this', { skip: true }, function(t) {
t.fail('this should not even run');
t.end();
});
t.end();
});
test('right number of tests ran', function(t) {
t.equal(ran, 3, 'ran the right number of tests');
t.end();
});
// vim: set softtabstop=4 shiftwidth=4: