1
1
/* eslint-env jasmine */
2
2
import { assertions } from 'redux-actions-assertions-js' ;
3
3
4
- const toDispatchActions = ( ) => {
4
+ function toDispatchActions ( ) {
5
5
return {
6
6
compare ( action , expectedActions , done ) {
7
7
assertions . toDispatchActions ( action , expectedActions , done , done . fail ) ;
8
8
return { pass : true } ;
9
+ } ,
10
+ negativeCompare ( action , expectedActions , done ) {
11
+ assertions . toNotDispatchActions ( action , expectedActions , done , done . fail ) ;
12
+ return { pass : true } ;
9
13
}
10
14
} ;
11
- } ;
15
+ }
12
16
13
- const toNotDispatchActions = ( ) => {
17
+ function toNotDispatchActions ( ) {
14
18
return {
15
19
compare ( action , expectedActions , done ) {
16
20
assertions . toNotDispatchActions ( action , expectedActions , done , done . fail ) ;
17
21
return { pass : true } ;
18
22
}
19
23
} ;
20
- } ;
24
+ }
21
25
22
- const toDispatchActionsWithState = ( ) => {
26
+ function toDispatchActionsWithState ( ) {
23
27
return {
24
28
compare ( action , state , expectedActions , done ) {
25
29
assertions . toDispatchActionsWithState ( state , action , expectedActions , done , done . fail ) ;
26
30
return { pass : true } ;
31
+ } ,
32
+ negativeCompare ( action , state , expectedActions , done ) {
33
+ assertions . toNotDispatchActionsWithState ( state , action , expectedActions , done , done . fail ) ;
34
+ return { pass : true } ;
27
35
}
28
36
} ;
29
- } ;
37
+ }
30
38
31
- const toNotDispatchActionsWithState = ( ) => {
39
+ function toNotDispatchActionsWithState ( ) {
32
40
return {
33
41
compare ( action , state , expectedActions , done ) {
34
42
assertions . toNotDispatchActionsWithState ( state , action , expectedActions , done , done . fail ) ;
35
43
return { pass : true } ;
36
44
}
37
45
} ;
38
- } ;
46
+ }
39
47
40
48
const matchers = {
41
49
toDispatchActions,
@@ -44,9 +52,9 @@ const matchers = {
44
52
toNotDispatchActionsWithState
45
53
} ;
46
54
47
- const registerAssertions = ( ) => {
55
+ function registerAssertions ( ) {
48
56
jasmine . addMatchers ( matchers ) ;
49
- } ;
57
+ }
50
58
51
59
export {
52
60
registerAssertions ,
0 commit comments