Skip to content
This repository has been archived by the owner on Nov 11, 2019. It is now read-only.

Latest commit

 

History

History
21 lines (16 loc) · 857 Bytes

MockStore.md

File metadata and controls

21 lines (16 loc) · 857 Bytes

Mock Store

Mock store contains redux state on which action can be applied. You can use it separately if you so desire:

import {MockStore} from 'mocha-redux-integration';

constructor(reducer, ?path)

Creates mock store with specified reducer and optionally its path inside the state tree, which is created with combineReducers from redux-immutable. This means the state pertaining to the reducer can be obtained by calling state.getIn(path).

Path can be specified either as an array or a single string literal.

apply(...actions)

Applies a sequence of actions on state using reducer and returns a new mock store with the resulting state (the interface is fluent).

select(selector, ...params)

Uses selector to retrieve value from state and returns it. Additional selector arguments can be specified.