Skip to content

Commit 7b0423c

Browse files
committedMay 8, 2015
verify that top-level tests can be defined asynchronously
This was an issue wiht TAP 0.x which I was reminded of recently. Since the rewrite, it's not a problem, because the underlying code was completely obliterated and designed in a cleaner way. However, it's always good to keep the ratchets around, so this test is here to prevent back-sliding on this issue.
1 parent 75b5b6c commit 7b0423c

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed
 

‎test/test/async.js

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
var t = require('../..')
2+
3+
t.test('first test', function (t) {
4+
t.pass('this is ok')
5+
t.end()
6+
})
7+
8+
setTimeout(function () {
9+
t.test('second test (async)', function (t) {
10+
t.pass('this is ok')
11+
t.end()
12+
})
13+
})

‎test/test/async.tap

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
TAP version 13
2+
# Subtest: first test
3+
ok 1 - this is ok
4+
1..1
5+
ok 1 - first test ___/# time=[0-9.]+(ms)?/~~~
6+
7+
# Subtest: second test (async)
8+
ok 1 - this is ok
9+
1..1
10+
ok 2 - second test (async) ___/# time=[0-9.]+(ms)?/~~~
11+
12+
1..2
13+
___/# time=[0-9.]+(ms)?/~~~
14+

0 commit comments

Comments
 (0)
Please sign in to comment.