Wrap throwsAsync with asyncTest

This commit is contained in:
Sosuke Suzuki 2024-05-17 23:10:59 +09:00 committed by Ms2ger
parent d9c67327ca
commit 57c7d06bf1

View File

@ -6,12 +6,15 @@ description: Promise.try returns a Promise that rejects when the function throws
esid: sec-promise.try esid: sec-promise.try
features: [promise-try] features: [promise-try]
flags: [async] flags: [async]
includes: [asyncHelpers.js]
---*/ ---*/
assert.throwsAsync( asyncTest(async function() {
await assert.throwsAsync(
Test262Error, Test262Error,
function () { function () {
Promise.try(function () { throw new Test262Error(); }) Promise.try(function () { throw new Test262Error(); })
}, },
"error thrown from callback must become a rejection" "error thrown from callback must become a rejection"
); );
});