cready
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

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

Package Sidebar

Install

npm i cready

Weekly Downloads

2

Version

1.0.0

License

MIT

Unpacked Size

5.18 kB

Total Files

7

Last publish

Collaborators

  • kuyoonjo