Repositorio del curso CCOM4030 el semestre B91 del proyecto kilometro0

nested-sync-noplan-noend.js 1.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. var tape = require('../');
  2. var tap = require('tap');
  3. var concat = require('concat-stream');
  4. tap.test('nested sync test without plan or end', function (tt) {
  5. tt.plan(1);
  6. var test = tape.createHarness();
  7. var tc = function (rows) {
  8. tt.same(rows.toString('utf8'), [
  9. 'TAP version 13',
  10. '# nested without plan or end',
  11. '# first',
  12. 'ok 1 should be truthy',
  13. '# second',
  14. 'ok 2 should be truthy',
  15. '',
  16. '1..2',
  17. '# tests 2',
  18. '# pass 2',
  19. '',
  20. '# ok'
  21. ].join('\n') + '\n');
  22. };
  23. test.createStream().pipe(concat(tc));
  24. test('nested without plan or end', function (t) {
  25. t.test('first', function (q) {
  26. setTimeout(function first() {
  27. q.ok(true);
  28. q.end();
  29. }, 10);
  30. });
  31. t.test('second', function (q) {
  32. setTimeout(function second() {
  33. q.ok(true);
  34. q.end();
  35. }, 10);
  36. });
  37. });
  38. });