test.js 367 B

123456789101112131415
  1. var sleep = require('./')
  2. describe('test.js', function () {
  3. it('should sleep', function * () {
  4. var start = new Date();
  5. yield sleep(30);
  6. (new Date - start).should.aboveOrEqual(30)
  7. })
  8. it('should sleep with human time string', function * () {
  9. var start = new Date();
  10. yield sleep('30ms');
  11. (new Date - start).should.aboveOrEqual(30)
  12. })
  13. })