Now, let's go ahead and look at the next one in our list, that is, the getExchangeRate function. There are actually two things that can go wrong here; the axios request can fail itself and we could also end up with a response that's valid, but the to status code is invalid. In that case, there would be no rate for it.
Now we can go ahead and actually simulate this by commenting out a few lines of code that's going to allow us to test to getExchangeRate in isolation:
const convertCurrencyAlt = async (from, to, amount) => { //const countries = await getCountries(to); const rate = await getExchangeRate(from, to); //const exchangedAmount = amount * rate; // //return `${amount} ${from} is worth ${exchangedAmount} ...