Skip to content

Commit 35cc7b0

Browse files
authored
chore(reactivity): correct the description of the test case (vuejs#4135)
1 parent 3056e9b commit 35cc7b0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/reactivity/__tests__/effect.spec.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -850,7 +850,7 @@ describe('reactivity/effect', () => {
850850
expect(dummy).toBe(1)
851851
})
852852

853-
it('should not be trigger when the value and the old value both are NaN', () => {
853+
it('should not be triggered when the value and the old value both are NaN', () => {
854854
const obj = reactive({
855855
foo: NaN
856856
})
@@ -884,13 +884,14 @@ describe('reactivity/effect', () => {
884884
expect(record).toBeUndefined()
885885
})
886886

887-
it('should trigger once effect when set the equal proxy', () => {
887+
it('should not be triggered when set with the same proxy', () => {
888888
const obj = reactive({ foo: 1 })
889889
const observed: any = reactive({ obj })
890890
const fnSpy = jest.fn(() => observed.obj)
891891

892892
effect(fnSpy)
893893

894+
expect(fnSpy).toHaveBeenCalledTimes(1)
894895
observed.obj = obj
895896
expect(fnSpy).toHaveBeenCalledTimes(1)
896897

@@ -900,6 +901,7 @@ describe('reactivity/effect', () => {
900901

901902
effect(fnSpy2)
902903

904+
expect(fnSpy2).toHaveBeenCalledTimes(1)
903905
observed2.obj2 = obj2
904906
expect(fnSpy2).toHaveBeenCalledTimes(1)
905907
})

0 commit comments

Comments
 (0)