Skip to content

Commit b728a7a

Browse files
committed
Use closure instead of withArgs
1 parent 171ab1e commit b728a7a

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

test/assertions/actionUtils.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
describe('assertions', () => {
99
describe('action utils', () => {
1010
describe('getDispatchedActions', () => {
11-
it('should be function', () => { expect(getDispatchedActions).toBeA('function');});
11+
it('should be function', () => { expect(getDispatchedActions).toBeA('function'); });
1212

1313
it('should return a Promise', () => {
1414
const result = getDispatchedActions({}, { type: '' });
@@ -32,7 +32,7 @@ describe('assertions', () => {
3232
};
3333
}
3434

35-
it('should be function', () => { expect(unrollActions).toBeA('function');});
35+
it('should be function', () => { expect(unrollActions).toBeA('function'); });
3636

3737
it('should return flat array with all actions', () => {
3838
unrollActions({}, asyncActionCreator()).then((result) => {
@@ -50,7 +50,7 @@ describe('assertions', () => {
5050
});
5151

5252
describe('assertDispatchedActions', () => {
53-
it('should be function', () => { expect(assertDispatchedActions).toBeA('function');});
53+
it('should be function', () => { expect(assertDispatchedActions).toBeA('function'); });
5454

5555
it('should throw error if expected action was not dispatched', () => {
5656
const dispatchedActions = [
@@ -62,8 +62,7 @@ describe('assertions', () => {
6262
{ type: '10-0' }
6363
];
6464

65-
expect(assertDispatchedActions)
66-
.withArgs([dispatchedActions, expectedActions])
65+
expect(() => { assertDispatchedActions(dispatchedActions, expectedActions); })
6766
.toThrow();
6867
});
6968
});

test/assertions/toDispatchActionsWithState.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,18 @@ describe('assertions', () => {
1414
expect.restoreSpies();
1515
});
1616

17-
it('should be function', () => { expect(toDispatchActionsWithState).toBeA('function');});
17+
it('should be function', () => { expect(toDispatchActionsWithState).toBeA('function'); });
1818

1919
describe('when "actualAction" is not a function or an object', () => {
2020
it('should throw Error', () => {
21-
expect(toDispatchActionsWithState)
22-
.withArgs(initialState, 'test', expectedAction, spyDone)
21+
expect(() => { toDispatchActionsWithState(initialState, 'test', expectedAction, spyDone); })
2322
.toThrow();
2423
});
2524
});
2625

2726
describe('when "expectedActions" not a function, not an object and not an array', () => {
2827
it('should throw Error', () => {
29-
expect(toDispatchActionsWithState)
30-
.withArgs([initialState, actualAction, 'test', spyDone])
28+
expect(() => { toDispatchActionsWithState(initialState, actualAction, 'test', spyDone); })
3129
.toThrow();
3230
});
3331
});

0 commit comments

Comments
 (0)