Skip to content

Commit

Permalink
Improve and optimize clear test
Browse files Browse the repository at this point in the history
  • Loading branch information
timursevimli committed Nov 30, 2024
1 parent 8f90c79 commit 536e4de
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions test/kuyruk.js
Original file line number Diff line number Diff line change
Expand Up @@ -440,9 +440,13 @@ test('Queue pipe handling', (t) => {
});

test('Should queue clear', (t) => {
const queue = new Kuyruk({ concurrency: 1 }).pause();
const queue = new Kuyruk({ concurrency: 1 }).pause().done(() => {
t.fail('Never should this line');
});

const dest = new Kuyruk({ concurrency: 1 });
const dest = new Kuyruk({ concurrency: 1 }).done(() => {
t.fail('Never should this line');
});

queue.pipe(dest);

Expand All @@ -455,7 +459,7 @@ test('Should queue clear', (t) => {
t.equal(queue.waiting.length, 3);
t.equal(queue.destination, dest);

queue.clear();
queue.clear().resume();

t.equal(queue.waiting.length, 0);
t.equal(queue.count, 0);
Expand Down

0 comments on commit 536e4de

Please sign in to comment.