Skip to content

Commit 88a5ced

Browse files
committed
chore: document hasOwnProperty Jest workaround
1 parent f923e95 commit 88a5ced

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/mount.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,8 @@ export function mount(
507507
console.warn = () => {}
508508

509509
const appRef = vm.$refs[MOUNT_COMPONENT_REF] as ComponentPublicInstance
510-
// we add `hasOwnProperty` so jest can spy on the proxied vm without throwing
510+
// we add `hasOwnProperty` so Jest can spy on the proxied vm without throwing
511+
// note that this is not necessary with Jest v27+ or Vitest, but is kept for compatibility with older Jest versions
511512
appRef.hasOwnProperty = (property) => {
512513
return Reflect.has(appRef, property)
513514
}

0 commit comments

Comments
 (0)