skip.js 944 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. 'use strict';
  2. var test = require('../');
  3. var concat = require('concat-stream');
  4. var tap = require('tap');
  5. tap.test('test SKIP comment', function (assert) {
  6. assert.plan(1);
  7. var verify = function (output) {
  8. assert.equal(output.toString('utf8'), [
  9. 'TAP version 13',
  10. '# SKIP skipped',
  11. '',
  12. '1..0',
  13. '# tests 0',
  14. '# pass 0',
  15. '',
  16. '# ok',
  17. ''
  18. ].join('\n'));
  19. };
  20. var tapeTest = test.createHarness();
  21. tapeTest.createStream().pipe(concat(verify));
  22. tapeTest('skipped', { skip: true }, function (t) {
  23. t.end();
  24. });
  25. });
  26. test('skip this', { skip: true }, function (t) {
  27. t.fail('this should not even run');
  28. t.end();
  29. });
  30. test.skip('skip this too', function (t) {
  31. t.fail('this should not even run');
  32. t.end();
  33. });
  34. test('skip subtest', function (t) {
  35. t.test('skip this', { skip: true }, function (st) {
  36. st.fail('this should not even run');
  37. st.end();
  38. });
  39. t.end();
  40. });
  41. // vim: set softtabstop=4 shiftwidth=4: