Skip to content

Commit 97b2f87

Browse files
committed
chore: prevent duplicate copyright
1 parent 745b73a commit 97b2f87

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

packages/reactivity/__tests__/computed.spec.ts

+8-6
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ import {
1616
import { DirtyLevels } from '../src/constants'
1717
import { COMPUTED_SIDE_EFFECT_WARN } from '../src/computed'
1818

19+
const normalizedSideEffectWarn = `[Vue warn] ${COMPUTED_SIDE_EFFECT_WARN}`
20+
1921
describe('reactivity/computed', () => {
2022
it('should return updated value', () => {
2123
const value = reactive<{ foo?: number }>({})
@@ -489,7 +491,7 @@ describe('reactivity/computed', () => {
489491
expect(c3.effect._dirtyLevel).toBe(
490492
DirtyLevels.MaybeDirty_ComputedSideEffect,
491493
)
492-
expect(COMPUTED_SIDE_EFFECT_WARN).toHaveBeenWarned()
494+
expect(normalizedSideEffectWarn).toHaveBeenWarned()
493495
})
494496

495497
it('should work when chained(ref+computed)', () => {
@@ -504,7 +506,7 @@ describe('reactivity/computed', () => {
504506
expect(c2.value).toBe('0foo')
505507
expect(c2.effect._dirtyLevel).toBe(DirtyLevels.Dirty)
506508
expect(c2.value).toBe('1foo')
507-
expect(COMPUTED_SIDE_EFFECT_WARN).toHaveBeenWarned()
509+
expect(normalizedSideEffectWarn).toHaveBeenWarned()
508510
})
509511

510512
it('should trigger effect even computed already dirty', () => {
@@ -527,7 +529,7 @@ describe('reactivity/computed', () => {
527529
expect(c2.effect._dirtyLevel).toBe(DirtyLevels.Dirty)
528530
v.value = 2
529531
expect(fnSpy).toBeCalledTimes(2)
530-
expect(COMPUTED_SIDE_EFFECT_WARN).toHaveBeenWarned()
532+
expect(normalizedSideEffectWarn).toHaveBeenWarned()
531533
})
532534

533535
// #10185
@@ -571,7 +573,7 @@ describe('reactivity/computed', () => {
571573
expect(c3.effect._dirtyLevel).toBe(DirtyLevels.MaybeDirty)
572574

573575
expect(c3.value).toBe('yes')
574-
expect(COMPUTED_SIDE_EFFECT_WARN).toHaveBeenWarned()
576+
expect(normalizedSideEffectWarn).toHaveBeenWarned()
575577
})
576578

577579
it('should be not dirty after deps mutate (mutate deps in computed)', async () => {
@@ -593,7 +595,7 @@ describe('reactivity/computed', () => {
593595
await nextTick()
594596
await nextTick()
595597
expect(serializeInner(root)).toBe(`2`)
596-
expect(COMPUTED_SIDE_EFFECT_WARN).toHaveBeenWarned()
598+
expect(normalizedSideEffectWarn).toHaveBeenWarned()
597599
})
598600

599601
it('should not trigger effect scheduler by recurse computed effect', async () => {
@@ -616,6 +618,6 @@ describe('reactivity/computed', () => {
616618
v.value += ' World'
617619
await nextTick()
618620
expect(serializeInner(root)).toBe('Hello World World World World')
619-
expect(COMPUTED_SIDE_EFFECT_WARN).toHaveBeenWarned()
621+
expect(normalizedSideEffectWarn).toHaveBeenWarned()
620622
})
621623
})

packages/reactivity/src/computed.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export interface WritableComputedOptions<T> {
2626
}
2727

2828
export const COMPUTED_SIDE_EFFECT_WARN =
29-
`[Vue warn] Computed keep dirty after evaluation.` +
29+
`Computed keep dirty after evaluation.` +
3030
` This might happen when you mutate the deps of computed in the getter.` +
3131
` Check the docs for more details: https://vuejs.org/guide/essentials/computed.html#getters-should-be-side-effect-free`
3232

0 commit comments

Comments
 (0)