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
1 changed files with 10 additions and 7 deletions

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() {
Test262Error, await assert.throwsAsync(
function () { Test262Error,
Promise.try(function () { throw new Test262Error(); }) function () {
}, Promise.try(function () { throw new Test262Error(); })
"error thrown from callback must become a rejection" },
); "error thrown from callback must become a rejection"
);
});