Skip to content

Tests not failing when expectations are not met #16

Closed
@jdmunro

Description

@jdmunro

If I set up a test that should fail because the dispatched actions do not meet the expectations, the test is in-fact passing which can be quite dangerous.

This is using redux-mock-store 0.0.6 and Jest 0.8.2.

I believe the problem lies here:

} catch (e) {
  if (done) {
    done(e);
  }
  throw e;
}

I was able to cause the test to fail as expected by simply not calling done, e.g:

} catch (e) {
  if (done) {
    //done(e);
  }
  throw e;
}

I'm not 100% sure if this is an issue with this library or one with Jest, therefore I have not put together a PR yet until the matter has been discussed.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions