Skip to content

Commit

Permalink
nested example completely works
Browse files Browse the repository at this point in the history
  • Loading branch information
James Halliday committed May 2, 2013
1 parent c4dc7ac commit a5e709e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions example/nested.js
Expand Up @@ -18,10 +18,10 @@ test('nested array test', function (t) {

t.test('inside test', function (q) {
q.plan(2);
q.ok(true);
q.ok(true, 'inside ok');

setTimeout(function () {
q.ok(true);
q.ok(true, 'inside delayed');
}, 3000);
});

Expand Down
4 changes: 2 additions & 2 deletions lib/results.js
Expand Up @@ -43,7 +43,7 @@ function Results (stream) {
Results.prototype.push = function (t, parentT) {
var self = this;
var write = function (s) { self.stream.queue(s) };
t.on('run', function () {
t.on('prerun', function () {
write('# ' + t.name + '\n');
});
if (parentT) {
Expand All @@ -64,7 +64,7 @@ Results.prototype.push = function (t, parentT) {
onend();
});
self.push(st, t);
if (subtests === 1) st.run();
if (subtests === 1) nextTick(function () { st.run() });
});

t.on('result', function (res) {
Expand Down
1 change: 1 addition & 0 deletions lib/test.js
Expand Up @@ -47,6 +47,7 @@ Test.prototype.run = function () {
if (this._skip) {
return this.end();
}
this.emit('prerun');
try {
this._cb(this);
}
Expand Down

0 comments on commit a5e709e

Please sign in to comment.