From 49311e50d855f35f412517f53fd73cae97954fb9 Mon Sep 17 00:00:00 2001 From: tuhm1 Date: Fri, 5 Jul 2024 14:34:31 +0700 Subject: [PATCH] Fix tests After v6 it takes 1 more microtask before starting an execution, so used `delay(0)` to wait instead. --- test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test.js b/test.js index c3ab72e..08bb306 100644 --- a/test.js +++ b/test.js @@ -190,7 +190,7 @@ test('change concurrency to smaller value', async t => { --running; }), ); - await Promise.resolve(); + await delay(0); t.is(running, 4); limit.concurrency = 2; @@ -210,7 +210,7 @@ test('change concurrency to bigger value', async t => { --running; }), ); - await Promise.resolve(); + await delay(0); t.is(running, 2); limit.concurrency = 4;