@@ -16,8 +16,6 @@ import {
16
16
import { DirtyLevels } from '../src/constants'
17
17
import { COMPUTED_SIDE_EFFECT_WARN } from '../src/computed'
18
18
19
- const normalizedSideEffectWarn = `[Vue warn] ${ COMPUTED_SIDE_EFFECT_WARN } `
20
-
21
19
describe ( 'reactivity/computed' , ( ) => {
22
20
it ( 'should return updated value' , ( ) => {
23
21
const value = reactive < { foo ?: number } > ( { } )
@@ -491,7 +489,7 @@ describe('reactivity/computed', () => {
491
489
expect ( c3 . effect . _dirtyLevel ) . toBe (
492
490
DirtyLevels . MaybeDirty_ComputedSideEffect ,
493
491
)
494
- expect ( normalizedSideEffectWarn ) . toHaveBeenWarned ( )
492
+ expect ( COMPUTED_SIDE_EFFECT_WARN ) . toHaveBeenWarned ( )
495
493
} )
496
494
497
495
it ( 'should work when chained(ref+computed)' , ( ) => {
@@ -506,7 +504,7 @@ describe('reactivity/computed', () => {
506
504
expect ( c2 . value ) . toBe ( '0foo' )
507
505
expect ( c2 . effect . _dirtyLevel ) . toBe ( DirtyLevels . Dirty )
508
506
expect ( c2 . value ) . toBe ( '1foo' )
509
- expect ( normalizedSideEffectWarn ) . toHaveBeenWarned ( )
507
+ expect ( COMPUTED_SIDE_EFFECT_WARN ) . toHaveBeenWarned ( )
510
508
} )
511
509
512
510
it ( 'should trigger effect even computed already dirty' , ( ) => {
@@ -529,7 +527,7 @@ describe('reactivity/computed', () => {
529
527
expect ( c2 . effect . _dirtyLevel ) . toBe ( DirtyLevels . Dirty )
530
528
v . value = 2
531
529
expect ( fnSpy ) . toBeCalledTimes ( 2 )
532
- expect ( normalizedSideEffectWarn ) . toHaveBeenWarned ( )
530
+ expect ( COMPUTED_SIDE_EFFECT_WARN ) . toHaveBeenWarned ( )
533
531
} )
534
532
535
533
// #10185
@@ -573,7 +571,7 @@ describe('reactivity/computed', () => {
573
571
expect ( c3 . effect . _dirtyLevel ) . toBe ( DirtyLevels . MaybeDirty )
574
572
575
573
expect ( c3 . value ) . toBe ( 'yes' )
576
- expect ( normalizedSideEffectWarn ) . toHaveBeenWarned ( )
574
+ expect ( COMPUTED_SIDE_EFFECT_WARN ) . toHaveBeenWarned ( )
577
575
} )
578
576
579
577
it ( 'should be not dirty after deps mutate (mutate deps in computed)' , async ( ) => {
@@ -595,7 +593,7 @@ describe('reactivity/computed', () => {
595
593
await nextTick ( )
596
594
await nextTick ( )
597
595
expect ( serializeInner ( root ) ) . toBe ( `2` )
598
- expect ( normalizedSideEffectWarn ) . toHaveBeenWarned ( )
596
+ expect ( COMPUTED_SIDE_EFFECT_WARN ) . toHaveBeenWarned ( )
599
597
} )
600
598
601
599
it ( 'should not trigger effect scheduler by recurse computed effect' , async ( ) => {
@@ -618,6 +616,6 @@ describe('reactivity/computed', () => {
618
616
v . value += ' World'
619
617
await nextTick ( )
620
618
expect ( serializeInner ( root ) ) . toBe ( 'Hello World World World World' )
621
- expect ( normalizedSideEffectWarn ) . toHaveBeenWarned ( )
619
+ expect ( COMPUTED_SIDE_EFFECT_WARN ) . toHaveBeenWarned ( )
622
620
} )
623
621
} )
0 commit comments