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