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

circular-things.js 1.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. var tape = require('../');
  2. var tap = require('tap');
  3. var concat = require('concat-stream');
  4. var stripFullStack = require('./common').stripFullStack;
  5. tap.test('circular test', function (assert) {
  6. var test = tape.createHarness({ exit : false });
  7. assert.plan(1);
  8. test.createStream().pipe(concat(function (body) {
  9. assert.equal(
  10. stripFullStack(body.toString('utf8')),
  11. 'TAP version 13\n'
  12. + '# circular\n'
  13. + 'not ok 1 should be equal\n'
  14. + ' ---\n'
  15. + ' operator: equal\n'
  16. + ' expected: |-\n'
  17. + ' {}\n'
  18. + ' actual: |-\n'
  19. + ' { circular: [Circular] }\n'
  20. + ' at: Test.<anonymous> ($TEST/circular-things.js:$LINE:$COL)\n'
  21. + ' stack: |-\n'
  22. + ' Error: should be equal\n'
  23. + ' [... stack stripped ...]\n'
  24. + ' at Test.<anonymous> ($TEST/circular-things.js:$LINE:$COL)\n'
  25. + ' [... stack stripped ...]\n'
  26. + ' ...\n'
  27. + '\n'
  28. + '1..1\n'
  29. + '# tests 1\n'
  30. + '# pass 0\n'
  31. + '# fail 1\n'
  32. );
  33. }));
  34. test("circular", function (t) {
  35. t.plan(1);
  36. var circular = {};
  37. circular.circular = circular;
  38. t.equal(circular, {});
  39. });
  40. });