timeout.js 264 B

1234567891011121314151617
  1. 'use strict';
  2. var test = require('../');
  3. var ran = 0;
  4. test('timeout', function (t) {
  5. t.pass('this should run');
  6. ran++;
  7. setTimeout(function () {
  8. t.end();
  9. }, 100);
  10. });
  11. test('should still run', { timeout: 50 }, function (t) {
  12. t.equal(ran, 1);
  13. t.end();
  14. });