Skip to content

Commit 7e56f8d

Browse files
committed
test: fix publicInstance test
1 parent dd81596 commit 7e56f8d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/runtime-core/__tests__/componentPublicInstance.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -336,16 +336,16 @@ describe('component: proxy', () => {
336336
instanceProxy.toggle()
337337
expect(getCalledTimes).toEqual(2)
338338

339-
// attaching spy, triggers the getter once, and override the property.
339+
// attaching spy, triggers the getter once, cache it and override the property.
340340
// also uses Object.defineProperty
341341
const spy = vi.spyOn(instanceProxy, 'toggle')
342342
expect(getCalledTimes).toEqual(3)
343343

344-
// vitest does not cache the spy like jest do
344+
// expect getter to not evaluate the jest spy caches its value
345345
const v3 = instanceProxy.toggle()
346346
expect(v3).toEqual('b')
347347
expect(spy).toHaveBeenCalled()
348-
expect(getCalledTimes).toEqual(4)
348+
expect(getCalledTimes).toEqual(3)
349349
})
350350

351351
test('defineProperty on proxy property with value descriptor', () => {

0 commit comments

Comments
 (0)