Const
Assertion for testing if a Promise rejects with a specific error type.
await expectAsync( Promise.reject(new TypeError('wrong')), 'to reject with a', TypeError,); // passesawait expectAsync( Promise.reject(new Error('wrong')), 'to reject with an', TypeError,); // fails Copy
await expectAsync( Promise.reject(new TypeError('wrong')), 'to reject with a', TypeError,); // passesawait expectAsync( Promise.reject(new Error('wrong')), 'to reject with an', TypeError,); // fails
Assertion for testing if a Promise rejects with a specific error type.