-
-
Notifications
You must be signed in to change notification settings - Fork 305
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use conf object, support skipping entire tests
Fix #2
- Loading branch information
Showing
3 changed files
with
72 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
var test = require('../'); | ||
var ran = 0; | ||
|
||
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'); | ||
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) { | ||
// https://github.com/substack/tape/issues/4 | ||
setTimeout(function() { | ||
t.equal(ran, 3, 'ran the right number of tests'); | ||
t.end(); | ||
}); | ||
}); | ||
|
||
// vim: set softtabstop=4 shiftwidth=4: |