From 88a5ced2b03ec5ba5eceb7f827083cf4fde4635c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Exbrayat?= Date: Sun, 13 Feb 2022 10:45:37 +0100 Subject: [PATCH] chore: document hasOwnProperty Jest workaround --- src/mount.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mount.ts b/src/mount.ts index 401b9caf0..d75b70904 100644 --- a/src/mount.ts +++ b/src/mount.ts @@ -507,7 +507,8 @@ export function mount( console.warn = () => {} const appRef = vm.$refs[MOUNT_COMPONENT_REF] as ComponentPublicInstance - // we add `hasOwnProperty` so jest can spy on the proxied vm without throwing + // we add `hasOwnProperty` so Jest can spy on the proxied vm without throwing + // note that this is not necessary with Jest v27+ or Vitest, but is kept for compatibility with older Jest versions appRef.hasOwnProperty = (property) => { return Reflect.has(appRef, property) }