We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 701fa73 commit 7c2e44fCopy full SHA for 7c2e44f
packages/reactivity/__tests__/ref.spec.ts
@@ -28,19 +28,18 @@ describe('reactivity/ref', () => {
28
it('should be reactive', () => {
29
const a = ref(1)
30
let dummy
31
- let calls = 0
32
- effect(() => {
33
- calls++
+ const fn = vi.fn(() => {
34
dummy = a.value
35
})
36
- expect(calls).toBe(1)
+ effect(fn)
+ expect(fn).toHaveBeenCalledTimes(1)
37
expect(dummy).toBe(1)
38
a.value = 2
39
- expect(calls).toBe(2)
+ expect(fn).toHaveBeenCalledTimes(2)
40
expect(dummy).toBe(2)
41
// same value should not trigger
42
43
44
45
46
it('should make nested properties reactive', () => {
0 commit comments