Skip to content

Commit

Permalink
[Test]: only use one test runner for results, even if multiple stream…
Browse files Browse the repository at this point in the history
…s are created

Fixes #105.
  • Loading branch information
nhamer authored and ljharb committed Oct 15, 2017
1 parent b494b18 commit fa586b4
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions test/create_multiple_streams.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
var tape = require('../');

tape.test('createMultipleStreams', function(tt) {
tt.plan(2);

var th = tape.createHarness();
th.createStream()
th.createStream()

var testOneComplete = false;

th('test one', function (tht) {
tht.plan(1);
setTimeout( function() {
tht.pass();
testOneComplete = true;
}, 100);
});

th('test two', function (tht) {
tht.ok(testOneComplete, 'test 1 completed before test 2');
tht.end();
});

th.onFinish(function() {
tt.equal(th._results.count, 2, "harness test ran");
tt.equal(th._results.fail, 0, "harness test didn't fail");
});
});


0 comments on commit fa586b4

Please sign in to comment.