From e0abeaa4dfdfd7b6c0c0c45b376845be0fbc1fed Mon Sep 17 00:00:00 2001 From: Rick Waldron Date: Thu, 12 Mar 2020 11:03:07 -0400 Subject: [PATCH] Promise.any: convert sync test to async test to ensure run to completion --- test/built-ins/Promise/any/invoke-then.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/test/built-ins/Promise/any/invoke-then.js b/test/built-ins/Promise/any/invoke-then.js index 57329e5691..95a630b11b 100644 --- a/test/built-ins/Promise/any/invoke-then.js +++ b/test/built-ins/Promise/any/invoke-then.js @@ -14,6 +14,8 @@ info: | Runtime Semantics: PerformPromiseAny r. Perform ? Invoke(nextPromise, "then", « resultCapability.[[Resolve]], rejectElement »). + +flags: [async] features: [Promise.any] ---*/ @@ -48,6 +50,8 @@ p1.then = p2.then = p3.then = function(a, b) { callCount += 1; }; -Promise.any([p1, p2, p3]); - -assert.sameValue(callCount, 3, '`then` invoked once for every iterated value'); +Promise.any([p1, p2, p3]) + .then(function() { + assert.sameValue(callCount, 3, '`then` invoked once for every iterated value'); + $DONE(); + }, $DONE);