Skip to content
This repository has been archived by the owner on Sep 17, 2019. It is now read-only.

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pikax committed Jan 14, 2018
1 parent 00e1a04 commit c418139
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions __tests__/interval_queue.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,12 @@ describe("interval pool", () => {
const queue = new QInterval();

const dt = Date.now();
queue.queue(successGen(1));
await queue.queue(()=>1);
const lapsed = Date.now() - dt;

expect(lapsed).toBeGreaterThanOrEqual(def_interval);
expect(lapsed).toBeLessThanOrEqual(def_interval + threshold)
expect(lapsed).toBeGreaterThanOrEqual(queue.interval);
expect(lapsed).toBeLessThanOrEqual(queue.interval + threshold)
});

it("should fail ", async () => {
Expand Down

0 comments on commit c418139

Please sign in to comment.