]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
chore(reactivity): correct the description of the test case (#4135)
authorPick <chenyi.c137@bytedance.com>
Mon, 19 Jul 2021 21:59:30 +0000 (05:59 +0800)
committerGitHub <noreply@github.com>
Mon, 19 Jul 2021 21:59:30 +0000 (17:59 -0400)
packages/reactivity/__tests__/effect.spec.ts

index 6a05038554bee528116a88d8bc98d2e45672beef..77d069fc6187e61ec1f8f359d499d8d49901139b 100644 (file)
@@ -850,7 +850,7 @@ describe('reactivity/effect', () => {
     expect(dummy).toBe(1)
   })
 
-  it('should not be trigger when the value and the old value both are NaN', () => {
+  it('should not be triggered when the value and the old value both are NaN', () => {
     const obj = reactive({
       foo: NaN
     })
@@ -884,13 +884,14 @@ describe('reactivity/effect', () => {
     expect(record).toBeUndefined()
   })
 
-  it('should trigger once effect when set the equal proxy', () => {
+  it('should not be triggered when set with the same proxy', () => {
     const obj = reactive({ foo: 1 })
     const observed: any = reactive({ obj })
     const fnSpy = jest.fn(() => observed.obj)
 
     effect(fnSpy)
 
+    expect(fnSpy).toHaveBeenCalledTimes(1)
     observed.obj = obj
     expect(fnSpy).toHaveBeenCalledTimes(1)
 
@@ -900,6 +901,7 @@ describe('reactivity/effect', () => {
 
     effect(fnSpy2)
 
+    expect(fnSpy2).toHaveBeenCalledTimes(1)
     observed2.obj2 = obj2
     expect(fnSpy2).toHaveBeenCalledTimes(1)
   })