utils/tests/time.spec.ts
ztimson 26cc18ffb3
Some checks failed
Build / Build NPM Project (push) Failing after 44s
Build / Publish Documentation (push) Has been skipped
Build / Tag Version (push) Has been skipped
Fixed path event, renamed testCondition to logicTest & fixed some tests
2025-05-11 11:46:03 -04:00

13 lines
313 B
TypeScript

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);
});
});
});