import createStore from '../../utility/algorithm/mini-redux/index';
describe('MiniRedux', () => {
interface IStaticAction {
const initialState: IStaticState = {
const reducer = (state: IStaticState, action: IStaticAction) => {
const store = createStore<IStaticState, IStaticAction>(reducer, initialState);
test('The method `store.getState()` should work fine', () => {
const state = store.getState();
expect(state.count).toBe(0);
test('The method `store.dispatch()` should work fine`', () => {
expect(store.getState().count).toBe(2);
test('The method `store.subscribe()` should work fine', () => {
expect(store.getState().count).toBe(0);