0👍
Jest docs say
it
expects the return value to be a Promise that is going to be
resolved.
You have a promise that is going to be rejected, so you need a Promise that resolves when your promise is rejected.
isRejected(rejectingPromise, someExpects) {
return new Promise((resolve) => {
rejectingPromise.then(
() => null, // if it resolves, fail
(err) => { // if it rejects, resolve
// Maybe do someExpects() here
resolve();
}
});
}
- [Vuejs]-How can i match with current user Id with firebase database data's value?
- [Vuejs]-I want to show the value of label inside the pie graph. (vue-chartjs / pieceLabel)
Source:stackexchange.com