From e54d905927c9f54c67a8d69f9a07fb4dbfc509b7 Mon Sep 17 00:00:00 2001 From: Giorgio Polvara Date: Tue, 8 May 2018 10:34:38 +0200 Subject: [PATCH] Change mockImplementationOnce to mockResolvedValueOnce --- README.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/README.md b/README.md index 0a66409f..6bf794a8 100644 --- a/README.md +++ b/README.md @@ -130,11 +130,7 @@ import Fetch from '../fetch' // see the tests for a full implementation test('Fetch makes an API call and displays the greeting when load-greeting is clicked', async () => { // Arrange - axiosMock.get.mockImplementationOnce(() => - Promise.resolve({ - data: {greeting: 'hello there'}, - }), - ) + axiosMock.get.mockResolvedValueOnce({ data: { greeting: 'hello there' } }) const url = '/greeting' const {getByText, getByTestId, container} = render()