Repositorio del curso CCOM4030 el semestre B91 del proyecto Artesanías con el Instituto de Cultura

create_multiple_streams.js 692B

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