Const
Assertion for testing if a function returns a fulfilled Promise.
await expectAsync(() => Promise.resolve('success'), 'to resolve'); // passesawait expectAsync(() => Promise.reject('error'), 'to fulfill'); // fails Copy
await expectAsync(() => Promise.resolve('success'), 'to resolve'); // passesawait expectAsync(() => Promise.reject('error'), 'to fulfill'); // fails
function-to-resolve
promise
Assertion for testing if a function returns a fulfilled Promise.