1.0.0 • Published 4 years ago
cready v1.0.0
Intro
Class Definition
class cReady {
/**
* Sets status to ready.
*/
public setAsReady(): void;
/**
* Returns status
*/
public ready(): Promise<void>;
}
Usage
test('Should ready after 2s', async () => {
const ready = new cReady();
const timeStart = new Date().getTime();
setTimeout(() => {
ready.setAsReady();
}, 2000);
await ready.ready();
const timeEnd = new Date().getTime();
expect(timeEnd - timeStart > 1000).toBe(true);
});
1.0.0
4 years ago