Jest

How to mock a function

(Very usefull when you are passing props to component which need dispatch)

1
const mockedFunc = jest.fn()

Preparing eslint for jest

1
npm i --save-dev eslint-plugin-jest

Then add jest to your .eslintrc list of plugins

⬆︎TOP