Comments (7)
@arnaudbenard Thanks for looking into this, I just discovered this was caused by the way I wrote some part of the code.
from redux-mock-store.
I am using mocha 2.5.3, chai as my assertion library
from redux-mock-store.
Can you please provide the code of your action and test including store preparation?
That would allow us to reproduce case.
from redux-mock-store.
I used test in your test folder
it('subscribes to dispatched actions', (done) => {
const store = mockStore();
const action = { type: 'ADD_ITEM' };
store.subscribe(() => {
expect('s').toEqual('a');
done();
});
store.dispatch(action);
});
so instead of failling the test, the test timeout, later I wrapped this with a try..catch and it worked that way. I wonder if that is the correct way to catch errors in store subscribe:
from redux-mock-store.
@r1cebank I ran you test locally and it failed, which version of node are you running?
➜ redux-mock-store (master) ✔ npm test
> [email protected] test /Users/arnaudbenard/Programming/redux-mock-store
> mocha --compilers js:babel/register --reporter spec test/*.js
redux-mock-store
1) subscribes to dispatched actions
0 passing (722ms)
1 failing
1) redux-mock-store subscribes to dispatched actions:
Error: Expected 's' to equal 'a'
+ expected - actual
-s
+a
at Object.assert [as default] (node_modules/expect/lib/assert.js:20:9)
at Expectation.toEqual (node_modules/expect/lib/Expectation.js:69:26)
at Array.<anonymous> (test/index.js:143:19)
at dispatch (src/index.js:40:25)
at Object.dispatch (node_modules/redux-thunk/lib/index.js:15:14)
at Context.<anonymous> (test/index.js:146:11)
npm ERR! Test failed. See above for more details.
from redux-mock-store.
I am using node v6.0.0
from redux-mock-store.
@r1cebank I tried with node v6 and it works. You should push your repo with the code. I can't reproduce your error.
from redux-mock-store.
Related Issues (20)
- Actions dispatched after using Promise.all don't save to store HOT 2
- Configuring store for all React tests HOT 1
- Cannot read property 'enqueueForceUpdate' of undefined
- Docs link is not working the NPM repo HOT 3
- Testing nested actions HOT 2
- Test with extra dispatched action in middleware
- update url's in package.json to point to latest location HOT 2
- What is in 1.5.4? HOT 1
- Issue with Store Helpers HOT 1
- The Documentation is wrong for CommonJS HOT 1
- does not work with nested async thunks? HOT 4
- Version 1.5.4? HOT 5
- [Redux-toolkit] [createEntityAdapter] Cannot read property 'ids' of undefined HOT 1
- getActions method doesn't log correct actions
- Usage with createAsyncThunk - 'await' has no effect on the type of this expression. HOT 1
- clearActions method isn't working as expected
- ESM problem with default export
- Add note that this is no longer recommended or maintained?
- redux-mock-store throws error after updating jest to latest versions HOT 2
- redux cannot read the property ids of undefined do you know why?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from redux-mock-store.