Repositorio del curso CCOM4030 el semestre B91 del proyecto kilometro0

undef.js 1.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. var tape = require('../');
  2. var tap = require('tap');
  3. var concat = require('concat-stream');
  4. var stripFullStack = require('./common').stripFullStack;
  5. tap.test('array test', function (tt) {
  6. tt.plan(1);
  7. var test = tape.createHarness();
  8. test.createStream().pipe(concat(function (body) {
  9. tt.equal(
  10. stripFullStack(body.toString('utf8')),
  11. 'TAP version 13\n'
  12. + '# undef\n'
  13. + 'not ok 1 should be equivalent\n'
  14. + ' ---\n'
  15. + ' operator: deepEqual\n'
  16. + ' expected: |-\n'
  17. + ' { beep: undefined }\n'
  18. + ' actual: |-\n'
  19. + ' {}\n'
  20. + ' at: Test.<anonymous> ($TEST/undef.js:$LINE:$COL)\n'
  21. + ' stack: |-\n'
  22. + ' Error: should be equivalent\n'
  23. + ' [... stack stripped ...]\n'
  24. + ' at Test.<anonymous> ($TEST/undef.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('undef', function (t) {
  35. t.plan(1);
  36. t.deepEqual({}, { beep: undefined });
  37. });
  38. });