UNPKG

692 BJavaScriptView Raw
1var tape = require('../');
2
3tape.test('createMultipleStreams', function (tt) {
4 tt.plan(2);
5
6 var th = tape.createHarness();
7 th.createStream();
8 th.createStream();
9
10 var testOneComplete = false;
11
12 th('test one', function (tht) {
13 tht.plan(1);
14 setTimeout( function () {
15 tht.pass();
16 testOneComplete = true;
17 }, 100);
18 });
19
20 th('test two', function (tht) {
21 tht.ok(testOneComplete, 'test 1 completed before test 2');
22 tht.end();
23 });
24
25 th.onFinish(function () {
26 tt.equal(th._results.count, 2, 'harness test ran');
27 tt.equal(th._results.fail, 0, "harness test didn't fail");
28 });
29});
30
31