Skip to content

Commit

Permalink
Reuse preloadedState per Terrence
Browse files Browse the repository at this point in the history
  • Loading branch information
brettjonesdev committed Feb 26, 2019
1 parent ffe7d52 commit 3fd3564
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/util/__tests__/createStore.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('createStore tests', () => {
const preloadedState = {count: 5}
const reducers = {count}
test('should combine reducers and create store capable of incrementing/decrementing count', () => {
const store = createStore({preloadedState: {count: 5}, reducers})
const store = createStore({preloadedState, reducers})
expect(store.getState()).toEqual({count: 5})
store.dispatch({type: INCREMENT_COUNT})
expect(store.getState()).toEqual({count: 6})
Expand All @@ -30,7 +30,7 @@ describe('createStore tests', () => {

describe('External Reducers tests', () => {
test('should add a `store.__unbindExternals` to the store', () => {
const store = createStore({preloadedState: {count: 5}, reducers})
const store = createStore({preloadedState, reducers})
expect(store.getState()).toEqual({count: 5})
expect(store.__unbindExternals).toBeInstanceOf(Function)
})
Expand Down Expand Up @@ -67,7 +67,7 @@ describe('createStore tests', () => {

test('should be able to pass a pre-combined reducer', () => {
const reducers = combineReducers({count})
const store = createStore({preloadedState: {count: 5}, reducers})
const store = createStore({preloadedState, reducers})
expect(store.__unbindExternals).toBe(undefined)
expect(store.getState()).toEqual({count: 5})
store.dispatch({type: INCREMENT_COUNT})
Expand Down

0 comments on commit 3fd3564

Please sign in to comment.