How to Unit Test React-Redux Connected Components?

前端 未结 5 2179
礼貌的吻别
礼貌的吻别 2020-11-27 14:40

I am using Mocha, Chai, Karma, Sinon, Webpack for Unit tests.

I followed this link to configure my testing environment for React-Redux Code.

How to implement

5条回答
  •  野性不改
    2020-11-27 15:35

    redux-mock-store is an awesome tool to test redux connected components in react

    const containerElement = shallow(());
    

    Create fake store and mount the component

    You may refer to this article Testing redux store connected React Components using Jest and Enzyme | TDD | REACT | REACT NATIVE

提交回复
热议问题