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

only.js 999B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. var tap = require('tap');
  2. var tape = require('../');
  3. var concat = require('concat-stream');
  4. tap.test('tape only test', function (tt) {
  5. var test = tape.createHarness({ exit: false });
  6. var ran = [];
  7. var tc = function (rows) {
  8. tt.deepEqual(rows.toString('utf8'), [
  9. 'TAP version 13',
  10. '# run success',
  11. 'ok 1 assert name',
  12. '',
  13. '1..1',
  14. '# tests 1',
  15. '# pass 1',
  16. '',
  17. '# ok'
  18. ].join('\n') + '\n');
  19. tt.deepEqual(ran, [ 3 ]);
  20. tt.end();
  21. };
  22. test.createStream().pipe(concat(tc));
  23. test("never run fail", function (t) {
  24. ran.push(1);
  25. t.equal(true, false);
  26. t.end();
  27. });
  28. test("never run success", function (t) {
  29. ran.push(2);
  30. t.equal(true, true);
  31. t.end();
  32. });
  33. test.only("run success", function (t) {
  34. ran.push(3);
  35. t.ok(true, "assert name");
  36. t.end();
  37. });
  38. });