Skip to content

Commit

Permalink
Return the resolved result of action dispatches (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
megawac authored and InterAl committed Jun 25, 2019
1 parent aa0162a commit e88e3a9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/SagaTester.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export default class SagaIntegrationTester {
}

dispatch(action) {
this.store.dispatch(action);
return this.store.dispatch(action);
}

getState() {
Expand Down
6 changes: 6 additions & 0 deletions test/SagaTester.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ describe('SagaTester', () => {
expect(sagaTester.getCalledActions()).to.deep.equal([]);
});

it('Dispatch returns the result of dispatching the action', () => {
const sagaTester = new SagaTester();
const action = sagaTester.dispatch(reduxAction);
expect(action).to.equal(reduxAction);
});

it('Captures redux action types if configured', () => {
const sagaTester = new SagaTester({ignoreReduxActions: false});
sagaTester.dispatch(reduxAction);
Expand Down

0 comments on commit e88e3a9

Please sign in to comment.