redux-things/redux-actions-assertions

Add Jest support

dmitry-zaets opened this issue · 1 comments

  • Add Custom Matchers for Jest:
    • toDispatchActions
    • not.toDispatchActions and/or toNotDispatchActions
    • withState
  • Add Tests for Jest
  • Add Tests with Jest as a step to npm test
  • Add Jest to Readme
  • Add Jest docs page with usage examples

I don't have time to do this right now, so leaving this here as a quick tip for anyone who needs it working ASAP:

  it('should run the correct actions', () => {
    return assertions.toDispatchActionsWithState(
      state,
      action(arg),
      expected,
      // done will be a thrown error if actions don't match expected
      done => expect(done).toBeUndefined()
    )
  })