Skip to content

Commit 6e1b0e9

Browse files
GpxKent C. Dodds
authored and
Kent C. Dodds
committed
tests: change mockImplementationOnce to mockResolvedValueOnce (#83)
1 parent 226c306 commit 6e1b0e9

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

README.md

+1-5
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,7 @@ import Fetch from '../fetch' // see the tests for a full implementation
130130

131131
test('Fetch makes an API call and displays the greeting when load-greeting is clicked', async () => {
132132
// Arrange
133-
axiosMock.get.mockImplementationOnce(() =>
134-
Promise.resolve({
135-
data: {greeting: 'hello there'},
136-
}),
137-
)
133+
axiosMock.get.mockResolvedValueOnce({ data: { greeting: 'hello there' } })
138134
const url = '/greeting'
139135
const {getByText, getByTestId, container} = render(<Fetch url={url} />)
140136

0 commit comments

Comments
 (0)