Closed alex-clear closed 2 years ago
Hey @alex-clear, can you try the following instead
jest.mock('react-toastify', () => {
// needed because your ToastContainer mock use jsx
const React = require("react") ;
const actual = jest.requireActual('react-toastify')
Object.assign(actual, {
toast: jest.fn(),
ToastContainer: jest.fn(() => <div />),
})
return actual
})
Thanks @fkhadra Solved
Hi guys First of all great lib! Thanks I am trying to build tests for my app When I add mock to you lib like:
I get next error:
I did not find any similar issues in web or in your issues Thanks for help
"react-toastify": "^8.2.0",