Giter Site home page Giter Site logo

Comments (7)

r1cebank avatar r1cebank commented on August 25, 2024 1

@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.

r1cebank avatar r1cebank commented on August 25, 2024

I am using mocha 2.5.3, chai as my assertion library

from redux-mock-store.

dmitry-zaets avatar dmitry-zaets commented on August 25, 2024

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.

r1cebank avatar r1cebank commented on August 25, 2024

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.

arnaudbenard avatar arnaudbenard commented on August 25, 2024

@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.

r1cebank avatar r1cebank commented on August 25, 2024

I am using node v6.0.0

from redux-mock-store.

arnaudbenard avatar arnaudbenard commented on August 25, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.