Even simpler way to check that some thread is active
This commit is contained in:
@@ -35,8 +35,7 @@ const testFile = file => test(file, async t => {
|
|||||||
return Promise.resolve()
|
return Promise.resolve()
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
// waiting for all threads to complete, then we return
|
// waiting for all threads to complete, then we return
|
||||||
|
while (vm.runtime.threads.some(thread => vm.runtime.isActiveThread(thread))) {
|
||||||
while (vm.runtime.threads.filter(thread => vm.runtime.isActiveThread(thread)).length > 0) {
|
|
||||||
if ((Date.now() - startTime) >= TIMEOUT) {
|
if ((Date.now() - startTime) >= TIMEOUT) {
|
||||||
// if we push the message after end, the failure from tap is not very useful:
|
// if we push the message after end, the failure from tap is not very useful:
|
||||||
// "not ok test after end() was called"
|
// "not ok test after end() was called"
|
||||||
|
|||||||
Reference in New Issue
Block a user