@o3r/testing
Version:
The module provides testing (e2e, unit test) utilities to help you build your own E2E pipeline integrating visual testing.
18 lines • 559 B
TypeScript
/**
* Determine if the given item is a promise
* @param item Item to check
*/
export declare const isPromise: <T>(item: T | Promise<T>) => item is Promise<T>;
/**
* Error raised when promise timeout
*/
export declare class TimeoutError extends Error {
constructor(message?: string);
}
/**
* Apply timeout to a given promise
* @param promise Promise to timeout
* @param timeout timeout of the given promise (in ms)
*/
export declare const withTimeout: <T>(promise: Promise<T>, timeout?: number) => Promise<T>;
//# sourceMappingURL=helpers.d.ts.map