1.0.0 • Published 4 years ago

cready v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

Build Status Coverage Status MIT license

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);
});