Skip to content

How to chain multiple expectations #40

@pandaiolo

Description

@pandaiolo

Sorry if the issues are not the correct place to ask a question!

I'd like to assert that an action is causing some other actions to trigger, but not others.

For example, doStuff() should trigger fooHappened() but not barDidNot()

Example code that I would like to build:

it('does stuff as expected', async done => {
  expect(doStuff())
    .toDispatchActions([fooHappened()], done)
    .toNotDispatchActions([barDidNot()], done)
})

Two things seem problematic above:

  1. Chaining the expectations? (I think not)
  2. Async management: calling done two times is probably going to break?

Currently, I'm making two different tests to assert for the same action, one to check what triggers as expected, one to check what is not triggered as expected

Is this the right way to do it?

Thanks for the hints.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions