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
features: [promise-try]
flags: [async]
includes: [asyncHelpers.js]
---*/
assert.throwsAsync(
Test262Error,
function () {
Promise.try(function () { throw new Test262Error(); })
},
"error thrown from callback must become a rejection"
);
asyncTest(async function() {
await assert.throwsAsync(
Test262Error,
function () {
Promise.try(function () { throw new Test262Error(); })
},
"error thrown from callback must become a rejection"
);
});