Unit tests - flux and data persistency Unit tests - flux and data persistency reactjs reactjs

Unit tests - flux and data persistency


Require your dispatcher, store and get the reference to the callback all within a beforeEach(). This blows away the old stuff and gives you fresh stuff for each test.

Example of this is in the blog post: http://facebook.github.io/react/blog/2014/09/24/testing-flux-applications.html#putting-it-all-together