Skip to content

Conversation

@dmitry-zaets
Copy link
Member

@dmitry-zaets dmitry-zaets commented Aug 25, 2016

Return a promise from assertion to allow chaining of assertions and Promise-based async tests

Related issues:

Old usage (mocha + expect):

it('<test name>',(done)=>{
  expect(fetchData()).toDispatchActions(expectedActions, done);
});

New usage (mocha + expect):

it('<test name>',()=>{
  return expect(fetchData()).toDispatchActions(expectedActions).then(()=>{
    expect(api.fetch).toHaveBeenCalled('/url');
  });
});

@dmitry-zaets dmitry-zaets changed the title Return Promise from assertion Return Promise from Assertions Aug 25, 2016
@dmitry-zaets dmitry-zaets merged commit 409cc4c into redux-things:master Aug 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant