0.1.1 • Published 4 years ago

redux-test-helpers v0.1.1

Weekly downloads
4
License
MIT
Repository
github
Last release
4 years ago

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);
});