Skip to content

Commit

Permalink
Update computed.spec.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsoncodehk committed Jan 16, 2024
1 parent 7781131 commit bb7316f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/reactivity/__tests__/computed.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -509,13 +509,15 @@ describe('reactivity/computed', () => {
}
return 'foo'
})
const v2 = computed(() => v.value + c1.value)
const c2 = computed(() => v.value + c1.value)

effect(() => {
fnSpy()
v2.value
c2.value
})
expect(fnSpy).toBeCalledTimes(1)
expect(c1.effect._dirtyLevel).toBe(DirtyLevels.Dirty)
expect(c2.effect._dirtyLevel).toBe(DirtyLevels.Dirty)
v.value = 2
expect(fnSpy).toBeCalledTimes(2)
})
Expand Down

0 comments on commit bb7316f

Please sign in to comment.