Skip to content

Commit a77a8f5

Browse files
author
Kent C. Dodds
authored
test: use mockResolvedValueOnce instead (#84)
1 parent 6e1b0e9 commit a77a8f5

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/__tests__/fetch.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,7 @@ class Fetch extends React.Component {
2929

3030
test('Fetch makes an API call and displays the greeting when load-greeting is clicked', async () => {
3131
// Arrange
32-
axiosMock.get.mockImplementationOnce(() =>
33-
Promise.resolve({
34-
data: {greeting: 'hello there'},
35-
}),
36-
)
32+
axiosMock.get.mockResolvedValueOnce({data: {greeting: 'hello there'}})
3733
const url = '/greeting'
3834
const {container, getByText} = render(<Fetch url={url} />)
3935

0 commit comments

Comments
 (0)