test: use delay() helper (#24321)

This commit is contained in:
Milan Burda 2020-06-26 22:59:54 +02:00 committed by GitHub
parent 8eb198bab4
commit 1c49e4e376
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 24 additions and 36 deletions

View file

@ -6,7 +6,7 @@ import * as v8 from 'v8';
export const ifit = (condition: boolean) => (condition ? it : it.skip);
export const ifdescribe = (condition: boolean) => (condition ? describe : describe.skip);
export const delay = (time: number) => new Promise(resolve => setTimeout(resolve, time));
export const delay = (time: number = 0) => new Promise(resolve => setTimeout(resolve, time));
type CleanupFunction = (() => void) | (() => Promise<void>)
const cleanupFunctions: CleanupFunction[] = [];