Skip to content

Commit

Permalink
Adding empty flush test
Browse files Browse the repository at this point in the history
  • Loading branch information
rishigupta1599 committed Nov 23, 2023
1 parent 0b77cdf commit 442fd69
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/core/test/unit/queue.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,16 @@ describe('Unit / Tasks Queue', () => {
expect(q.size).toBe(0);
});

it('empty flush', async () => {
q.set({ concurrency: 1 });
await q.start();
q.readyState = 2;
expect(q.size).toBe(0);
let promise = generatePromise(q.flush());
await expectAsync(promise).toBePending();
await expectAsync(promise).toBeResolved();
});

it('cancels the flush when aborted', async () => {
let resolve, deferred = new Promise(r => (resolve = r));
let p1 = q.push(deferred);
Expand Down

0 comments on commit 442fd69

Please sign in to comment.