Skip to content

Commit 8b908f8

Browse files
committed
Add support for negativeCompare, use function syntax
1 parent 50a1bf0 commit 8b908f8

File tree

1 file changed

+18
-10
lines changed

1 file changed

+18
-10
lines changed

src/jasmine.js

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,49 @@
11
/* eslint-env jasmine */
22
import { assertions } from 'redux-actions-assertions-js';
33

4-
const toDispatchActions = () => {
4+
function toDispatchActions() {
55
return {
66
compare(action, expectedActions, done) {
77
assertions.toDispatchActions(action, expectedActions, done, done.fail);
88
return { pass: true };
9+
},
10+
negativeCompare(action, expectedActions, done) {
11+
assertions.toNotDispatchActions(action, expectedActions, done, done.fail);
12+
return { pass: true };
913
}
1014
};
11-
};
15+
}
1216

13-
const toNotDispatchActions = () => {
17+
function toNotDispatchActions() {
1418
return {
1519
compare(action, expectedActions, done) {
1620
assertions.toNotDispatchActions(action, expectedActions, done, done.fail);
1721
return { pass: true };
1822
}
1923
};
20-
};
24+
}
2125

22-
const toDispatchActionsWithState = () => {
26+
function toDispatchActionsWithState() {
2327
return {
2428
compare(action, state, expectedActions, done) {
2529
assertions.toDispatchActionsWithState(state, action, expectedActions, done, done.fail);
2630
return { pass: true };
31+
},
32+
negativeCompare(action, state, expectedActions, done) {
33+
assertions.toNotDispatchActionsWithState(state, action, expectedActions, done, done.fail);
34+
return { pass: true };
2735
}
2836
};
29-
};
37+
}
3038

31-
const toNotDispatchActionsWithState = () => {
39+
function toNotDispatchActionsWithState() {
3240
return {
3341
compare(action, state, expectedActions, done) {
3442
assertions.toNotDispatchActionsWithState(state, action, expectedActions, done, done.fail);
3543
return { pass: true };
3644
}
3745
};
38-
};
46+
}
3947

4048
const matchers = {
4149
toDispatchActions,
@@ -44,9 +52,9 @@ const matchers = {
4452
toNotDispatchActionsWithState
4553
};
4654

47-
const registerAssertions = () => {
55+
function registerAssertions() {
4856
jasmine.addMatchers(matchers);
49-
};
57+
}
5058

5159
export {
5260
registerAssertions,

0 commit comments

Comments
 (0)