Assert that input is a rejected Promise result.
input
Promise
const [result] = await Promise.allSettled([Promise.reject(new Error('fail'))]);assertIsPromiseRejectedResult(result); // does not throwassertIsPromiseRejectedResult({ status: 'fulfilled' }); // throws TypeError: input is not a promise rejected result Copy
const [result] = await Promise.allSettled([Promise.reject(new Error('fail'))]);assertIsPromiseRejectedResult(result); // does not throwassertIsPromiseRejectedResult({ status: 'fulfilled' }); // throws TypeError: input is not a promise rejected result
Assert that
inputis a rejectedPromiseresult.