auth-api/tests/node_modules/tape/test/create_multiple_streams.js

34 lines
707 B
JavaScript
Raw Normal View History

2021-06-23 22:30:45 +02:00
'use strict';
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");
});
});