mirror of
https://github.com/dkershner6/post-api-call-action.git
synced 2024-12-27 19:33:55 +08:00
15 lines
417 B
TypeScript
15 lines
417 B
TypeScript
import { wait } from '../src/wait';
|
|
|
|
test('throws invalid number', async () => {
|
|
const input = parseInt('foo', 10);
|
|
await expect(wait(input)).rejects.toThrow('milliseconds not a number');
|
|
});
|
|
|
|
test('wait 500 ms', async () => {
|
|
const start = new Date();
|
|
await wait(500);
|
|
const end = new Date();
|
|
var delta = Math.abs(end.getTime() - start.getTime());
|
|
expect(delta).toBeGreaterThan(450);
|
|
});
|