Repositorio del curso CCOM4030 el semestre B91 del proyecto Paz para la Mujer

todo.js 1.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. var tap = require('tap');
  2. var tape = require('../');
  3. var concat = require('concat-stream');
  4. var common = require('./common');
  5. var stripFullStack = common.stripFullStack;
  6. tap.test('tape todo test', function (assert) {
  7. var test = tape.createHarness({ exit: false });
  8. assert.plan(1);
  9. test.createStream().pipe(concat(function (body) {
  10. assert.equal(
  11. stripFullStack(body.toString('utf8')),
  12. 'TAP version 13\n'
  13. + '# success\n'
  14. + 'ok 1 this test runs\n'
  15. + '# TODO failure\n'
  16. + 'not ok 2 should never happen # TODO\n'
  17. + ' ---\n'
  18. + ' operator: fail\n'
  19. + ' at: Test.<anonymous> ($TEST/todo.js:$LINE:$COL)\n'
  20. + ' ...\n'
  21. + '\n'
  22. + '1..2\n'
  23. + '# tests 2\n'
  24. + '# pass 2\n'
  25. + '\n'
  26. + '# ok\n'
  27. );
  28. }));
  29. test('success', function (t) {
  30. t.equal(true, true, 'this test runs');
  31. t.end();
  32. });
  33. test('failure', { todo: true }, function (t) {
  34. t.fail('should never happen');
  35. t.end();
  36. });
  37. });