@qntm-code/utils
Version:
A collection of useful utility functions with associated TypeScript types. All functions have been unit tested.
18 lines (17 loc) • 644 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const src_1 = require("../../src");
describe('delay', () => {
it('should wait for the delay to complete before continuing execution', async () => {
let resolved = false;
setTimeout(() => (resolved = true), 10);
await (0, src_1.delay)(20);
expect(resolved).toBe(true);
});
it('should wait for the delay to complete before continuing execution', async () => {
let resolved = false;
setTimeout(() => (resolved = true), 30);
await (0, src_1.delay)(20);
expect(resolved).toBe(false);
});
});