Skip to content

Commit

Permalink
fix: remove hasOwnProperty workaround
Browse files Browse the repository at this point in the history
vue-test-utils-next now uses jest v27.1+, which includes a fix for hasOwnPropery (see jestjs/jest#11721).
This allows to remove the dirty workaround we had in our codebase, but users will have to update to Jest v27.1+.
  • Loading branch information
cexbrayat committed Aug 30, 2021
1 parent 226d3f1 commit c900b06
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions src/mount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -464,10 +464,6 @@ export function mount(
// if not, use the return value from app.mount.
const appRef = vm.$refs[MOUNT_COMPONENT_REF] as ComponentPublicInstance
const $vm = Reflect.ownKeys(appRef).length ? appRef : vm
// we add `hasOwnProperty` so jest can spy on the proxied vm without throwing
$vm.hasOwnProperty = (property) => {
return Reflect.has($vm, property)
}
console.warn = warnSave
return createWrapper(app, $vm, setProps)
}
Expand Down

0 comments on commit c900b06

Please sign in to comment.