Fixed path event, renamed testCondition to logicTest & fixed some tests
This commit is contained in:
12
tests/time.spec.ts
Normal file
12
tests/time.spec.ts
Normal file
@ -0,0 +1,12 @@
|
||||
import {sleep} from '../src';
|
||||
|
||||
describe('Time Utilities', () => {
|
||||
describe('sleep', () => {
|
||||
test('wait until', async () => {
|
||||
const wait = ~~(Math.random() * 500);
|
||||
const time = new Date().getTime();
|
||||
await sleep(wait);
|
||||
expect(new Date().getTime()).toBeGreaterThanOrEqual(time + wait);
|
||||
});
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user