Question: Mocking Reflux.js store during React component shallow rendering in test with enzyme

Question

Mocking Reflux.js store during React component shallow rendering in test with enzyme

Answers 0
Added at 2016-10-24 00:10
Tags
Question

I'm writing React application. I want to test in isolation component that is wired up with Reflux.js store with:

  mixins: [
    Reflux.connect(CountriesStore)
  ],

Initialization code of CountresStore calls action that tries to fetch list of countries. This is the stop where some exception is being raised. But I feel that all this fuzz should not occur. I want to conduct unit, not integration testing. So,

Is there a way to mock this CountriesStore prior of it being called during initialization of component?

Answers
Source Show
◀ Wstecz