expect(jest.fn()).toHaveBeenCalled()

Started 4 months ago by Dhanasekar in React Native

should call onPress handler when pressed expect(jest.fn()).toHaveBeenCalled() Expected number of calls: >=...

Body

should call onPress handler when pressed

    expect(jest.fn()).toHaveBeenCalled()

    Expected number of calls: >= 1
    Received number of calls:    0

      381 |         );
      382 |         fireEvent.press(getByTestId('pressable-button'));
    > 383 |         expect(onPressMock).toHaveBeenCalled();
          |                             ^
      384 |     });
      385 | });

      at Object.toHaveBeenCalled (__tests__/screen.test.tsx:383:29)
  • No one is replied to this thread yet. Be first to reply!