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
})
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)
effect(fnSpy2)
+ expect(fnSpy2).toHaveBeenCalledTimes(1)
observed2.obj2 = obj2
expect(fnSpy2).toHaveBeenCalledTimes(1)
})