@@ -95,6 +95,7 @@ describe('Helpers', () => {
95
95
} )
96
96
97
97
it ( 'mapState (with undefined states)' , ( ) => {
98
+ spyOn ( console , 'error' )
98
99
const store = new Vuex . Store ( {
99
100
modules : {
100
101
foo : {
@@ -108,6 +109,7 @@ describe('Helpers', () => {
108
109
computed : mapState ( 'foo' )
109
110
} )
110
111
expect ( vm . a ) . toBeUndefined ( )
112
+ expect ( console . error ) . toHaveBeenCalledWith ( '[vuex] mapState: mapper parameter must be either an Array or an Object' )
111
113
} )
112
114
113
115
it ( 'mapMutations (array)' , ( ) => {
@@ -223,6 +225,7 @@ describe('Helpers', () => {
223
225
} )
224
226
225
227
it ( 'mapMutations (with undefined mutations)' , ( ) => {
228
+ spyOn ( console , 'error' )
226
229
const store = new Vuex . Store ( {
227
230
modules : {
228
231
foo : {
@@ -241,6 +244,7 @@ describe('Helpers', () => {
241
244
} )
242
245
expect ( vm . inc ) . toBeUndefined ( )
243
246
expect ( vm . dec ) . toBeUndefined ( )
247
+ expect ( console . error ) . toHaveBeenCalledWith ( '[vuex] mapMutations: mapper parameter must be either an Array or an Object' )
244
248
} )
245
249
246
250
it ( 'mapGetters (array)' , ( ) => {
@@ -389,6 +393,7 @@ describe('Helpers', () => {
389
393
} )
390
394
391
395
it ( 'mapGetters (with undefined getters)' , ( ) => {
396
+ spyOn ( console , 'error' )
392
397
const store = new Vuex . Store ( {
393
398
modules : {
394
399
foo : {
@@ -411,6 +416,7 @@ describe('Helpers', () => {
411
416
} )
412
417
expect ( vm . a ) . toBeUndefined ( )
413
418
expect ( vm . b ) . toBeUndefined ( )
419
+ expect ( console . error ) . toHaveBeenCalledWith ( '[vuex] mapGetters: mapper parameter must be either an Array or an Object' )
414
420
} )
415
421
416
422
it ( 'mapActions (array)' , ( ) => {
@@ -524,6 +530,7 @@ describe('Helpers', () => {
524
530
} )
525
531
526
532
it ( 'mapActions (with undefined actions)' , ( ) => {
533
+ spyOn ( console , 'error' )
527
534
const a = jasmine . createSpy ( )
528
535
const store = new Vuex . Store ( {
529
536
modules : {
@@ -541,6 +548,7 @@ describe('Helpers', () => {
541
548
} )
542
549
expect ( vm . a ) . toBeUndefined ( )
543
550
expect ( a ) . not . toHaveBeenCalled ( )
551
+ expect ( console . error ) . toHaveBeenCalledWith ( '[vuex] mapActions: mapper parameter must be either an Array or an Object' )
544
552
} )
545
553
546
554
it ( 'createNamespacedHelpers' , ( ) => {
0 commit comments