Skip to content

Commit

Permalink
[Tests] missing t.end(); avoid shadowing
Browse files Browse the repository at this point in the history
  • Loading branch information
nhamer authored and ljharb committed Oct 14, 2017
1 parent 614c4d0 commit 144a361
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
8 changes: 4 additions & 4 deletions test/add-subtest-async.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ var test = require('../')
test('parent', function (t) {
t.pass('parent');
setTimeout(function () {
t.test('child', function (t) {
t.pass('child');
t.end();
t.test('child', function (st) {
st.pass('child');
st.end();
});
}, 100)
}, 100);
})
18 changes: 10 additions & 8 deletions test/subtest_and_async.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,21 @@ var asyncFunction = function (callback) {
};

test('master test', function (t) {
t.test('subtest 1', function (t) {
t.pass('subtest 1 before async call');
t.test('subtest 1', function (st) {
st.pass('subtest 1 before async call');
asyncFunction(function () {
t.pass('subtest 1 in async callback');
t.end();
st.pass('subtest 1 in async callback');
st.end();
})
});

t.test('subtest 2', function (t) {
t.pass('subtest 2 before async call');
t.test('subtest 2', function (st) {
st.pass('subtest 2 before async call');
asyncFunction(function () {
t.pass('subtest 2 in async callback');
t.end();
st.pass('subtest 2 in async callback');
st.end();
})
});

t.end();
});

0 comments on commit 144a361

Please sign in to comment.