Files

13 lines
344 B
JavaScript
Raw Permalink Normal View History

2019-01-24 15:03:34 +08:00
const wait = require('../../lib/utils/wait');
2019-01-23 11:38:09 +08:00
describe('wait', () => {
it('wait 0.1 second', async () => {
const startDate = new Date();
await wait(0.1 * 1000);
const endDate = new Date();
2019-01-24 11:31:51 +08:00
expect(endDate - startDate).toBeGreaterThan(90);
2019-11-25 12:10:39 +08:00
expect(endDate - startDate).toBeLessThan(150);
2019-01-23 11:38:09 +08:00
});
});