Skip to content

Commit 144a361

Browse files
nhamerljharb
authored andcommitted
[Tests] missing t.end(); avoid shadowing
1 parent 614c4d0 commit 144a361

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

test/add-subtest-async.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ var test = require('../')
33
test('parent', function (t) {
44
t.pass('parent');
55
setTimeout(function () {
6-
t.test('child', function (t) {
7-
t.pass('child');
8-
t.end();
6+
t.test('child', function (st) {
7+
st.pass('child');
8+
st.end();
99
});
10-
}, 100)
10+
}, 100);
1111
})

test/subtest_and_async.js

+10-8
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,21 @@ var asyncFunction = function (callback) {
55
};
66

77
test('master test', function (t) {
8-
t.test('subtest 1', function (t) {
9-
t.pass('subtest 1 before async call');
8+
t.test('subtest 1', function (st) {
9+
st.pass('subtest 1 before async call');
1010
asyncFunction(function () {
11-
t.pass('subtest 1 in async callback');
12-
t.end();
11+
st.pass('subtest 1 in async callback');
12+
st.end();
1313
})
1414
});
1515

16-
t.test('subtest 2', function (t) {
17-
t.pass('subtest 2 before async call');
16+
t.test('subtest 2', function (st) {
17+
st.pass('subtest 2 before async call');
1818
asyncFunction(function () {
19-
t.pass('subtest 2 in async callback');
20-
t.end();
19+
st.pass('subtest 2 in async callback');
20+
st.end();
2121
})
2222
});
23+
24+
t.end();
2325
});

0 commit comments

Comments
 (0)