-
Notifications
You must be signed in to change notification settings - Fork 149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test passes even if not all expected actions are dispatched #12
Comments
I have the same issue here, i did notice the examples were in mocha and I use jasmine, so that could be the problem maybe? |
The issue lies here, where For example, If you provide the mock store with a single expected action, and dispatch an async action creator that then dispatches multiple other actions, the I'm looking into ways to fix this. |
I also notice that this is using and in deep equal docs it states
but in the latest tag on the expect lib https://www.npmjs.com/package/is-equal but changing line 38 in redux-mock-store from Hope this helps, trying more things... UPDATE - looks like you just need to updates expect to 1.13.4 verified upgrading to expect 1.13.4 works |
So redux mock store should be compatible with jasmine? |
There shouldn't be any difference between using mocha and jasmine, the bug exists no matter which test suite you use. |
For some reason switching to mocha fixes the issue for me.
this is the test:
When using Jasmine I can just modify expectedActions and everyting still succeeds, with mocha I cannot:
I don't know why or what I more information I can give you. I used UPDATE |
same issue explained by @ngerritsen. import { createAction } from 'redux-actions';
import types from '../../lib/constants/ActionTypes';
// ...
const expectedActions = [
act => expect(act).toEqual(createAction(types.FETCH_POSTS_REQUEST)()),
act => expect(act).toEqual(createAction(types.FETCH_POSTS_SUCCESS)(posts)),
]; |
+1. |
according to jasmine documentation, |
Yes I believe that's the issue. |
In the meantime, here's a temporary module for Jasmine (and Mocha): https://www.npmjs.com/package/redux-mock-store-jasmine |
There's a new version out, please give it a try 👍 |
I have the following set-up
actions.js
actions-test.js
Running the above test passes as expected.
The problem is if I uncomment
the test still passes even though now only one of the 3
expectedActions
is dispatched.Is this a bug, or am I misunderstanding something?
The text was updated successfully, but these errors were encountered: