Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default function configureStore (middlewares = []) {
actions.push(action)

for (let i = 0; i < listeners.length; i++) {
listeners[i]()
listeners[i](action)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this action be passed in here after removing the type property?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless there's a huge demand for it, I'd leave the type property, it gives more rich info to any listeners in test.

}

return action
Expand Down
3 changes: 2 additions & 1 deletion test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,9 @@ describe('redux-mock-store', () => {
const store = mockStore()
const action = { type: 'ADD_ITEM' }

store.subscribe(() => {
store.subscribe((a) => {
expect(store.getActions()[0]).toEqual(action)
expect(action).toEqual(a)
done()
})
store.dispatch(action)
Expand Down