From ab8fda16552bf1d23f5e7481f763333f07d3ee7d Mon Sep 17 00:00:00 2001 From: Corey Frang Date: Thu, 10 May 2018 16:17:38 -0400 Subject: [PATCH] Even simpler way to check that some thread is active --- test/integration/scratch-tests.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/integration/scratch-tests.js b/test/integration/scratch-tests.js index 651b544..668d72e 100644 --- a/test/integration/scratch-tests.js +++ b/test/integration/scratch-tests.js @@ -35,8 +35,7 @@ const testFile = file => test(file, async t => { return Promise.resolve() .then(async () => { // waiting for all threads to complete, then we return - - while (vm.runtime.threads.filter(thread => vm.runtime.isActiveThread(thread)).length > 0) { + while (vm.runtime.threads.some(thread => vm.runtime.isActiveThread(thread))) { if ((Date.now() - startTime) >= TIMEOUT) { // if we push the message after end, the failure from tap is not very useful: // "not ok test after end() was called"