has spaces.js 935 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. 'use strict';
  2. var tape = require('../');
  3. var tap = require('tap');
  4. var concat = require('concat-stream');
  5. var stripFullStack = require('./common').stripFullStack;
  6. tap.test('array test', function (tt) {
  7. tt.plan(1);
  8. var test = tape.createHarness({ exit: false });
  9. var tc = function (rows) {
  10. tt.same(stripFullStack(rows.toString('utf8')), [
  11. 'TAP version 13',
  12. '# fail',
  13. 'not ok 1 this should fail',
  14. ' ---',
  15. ' operator: fail',
  16. ' at: Test.<anonymous> ($TEST/has spaces.js:$LINE:$COL)',
  17. ' stack: |-',
  18. ' Error: this should fail',
  19. ' [... stack stripped ...]',
  20. ' at Test.<anonymous> ($TEST/has spaces.js:$LINE:$COL)',
  21. ' [... stack stripped ...]',
  22. ' ...',
  23. '',
  24. '1..1',
  25. '# tests 1',
  26. '# pass 0',
  27. '# fail 1',
  28. ''
  29. ]);
  30. };
  31. test.createStream().pipe(concat(tc));
  32. test('fail', function (t) {
  33. t.fail('this should fail');
  34. t.end();
  35. });
  36. });