0.1.1 • Published 4 years ago
redux-test-helpers v0.1.1
Redux Test Helpers
Make testing redux great again
Usage
import { testReducer } from "redux-test-helpers";
it("should toggle loading state", () => {
testReducer(reducer)
.expect(selectLoading, false)
.put(actions.fetchRequest())
.expect(selectLoading, true)
.put(actions.fetchSuccess())
.expect(selectLoading, false)
.put(actions.fetchRequest())
.put(actions.fetchFail())
.expect(selectLoading, false);
});
0.1.1
4 years ago