Last active
February 22, 2021 18:37
-
-
Save fernandodof/89caf28315764fd862393752adac07ac to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe('When the promise is rejected', () => { | |
beforeEach(async () => { | |
fetch.mockRejectedValueOnce(new Error("I'm a teapot")); | |
averagePrice = await getPricesLastDays(7); | |
}); | |
it('Then the fuction should return null', () => { | |
expect(averagePrice).toEqual(null); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment