@@ -17,6 +17,8 @@ describe('bindActionCreators', () => {
17
17
} )
18
18
19
19
it ( 'wraps the action creators with the dispatch function' , ( ) => {
20
+ const _console = console
21
+ global . console = { error : jest . fn ( ) }
20
22
const boundActionCreators = bindActionCreators ( actionCreators , store . dispatch )
21
23
expect (
22
24
Object . keys ( boundActionCreators )
@@ -31,9 +33,13 @@ describe('bindActionCreators', () => {
31
33
expect ( store . getState ( ) ) . toEqual ( [
32
34
{ id : 1 , text : 'Hello' }
33
35
] )
36
+ expect ( console . error ) . toHaveBeenCalled ( )
37
+ global . console = _console
34
38
} )
35
39
36
40
it ( 'skips non-function values in the passed object' , ( ) => {
41
+ const _console = console
42
+ global . console = { error : jest . fn ( ) }
37
43
const boundActionCreators = bindActionCreators ( {
38
44
...actionCreators ,
39
45
foo : 42 ,
@@ -47,6 +53,9 @@ describe('bindActionCreators', () => {
47
53
) . toEqual (
48
54
Object . keys ( actionCreatorFunctions )
49
55
)
56
+ // 6 instead of 5 because of `__esModule: true` property from importing `actionCreators`
57
+ expect ( console . error . mock . calls . length ) . toBe ( 6 )
58
+ global . console = _console
50
59
} )
51
60
52
61
it ( 'supports wrapping a single function only' , ( ) => {
0 commit comments