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 Feb 11, 2022
1 parent c3ecb45 commit 51f8399
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,13 @@
"vuex": "^4.0.2"
},
"peerDependencies": {
"vue": "^3.0.1"
"vue": "^3.0.1",
"jest": "^27.1.0"
},
"peerDependenciesMeta": {
"jest": {
"optional": true
}
},
"author": {
"name": "Lachlan Miller",
Expand Down
4 changes: 0 additions & 4 deletions src/mount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -507,10 +507,6 @@ 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
appRef.hasOwnProperty = (property) => {
return Reflect.has(appRef, property)
}
console.warn = warnSave
const wrapper = createVueWrapper(app, appRef, setProps)
trackInstance(wrapper)
Expand Down

0 comments on commit 51f8399

Please sign in to comment.