Skip to content

Commit 51f8399

Browse files
committed
fix: remove hasOwnProperty workaround
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+.
1 parent c3ecb45 commit 51f8399

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

package.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,13 @@
5151
"vuex": "^4.0.2"
5252
},
5353
"peerDependencies": {
54-
"vue": "^3.0.1"
54+
"vue": "^3.0.1",
55+
"jest": "^27.1.0"
56+
},
57+
"peerDependenciesMeta": {
58+
"jest": {
59+
"optional": true
60+
}
5561
},
5662
"author": {
5763
"name": "Lachlan Miller",

src/mount.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -507,10 +507,6 @@ 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
511-
appRef.hasOwnProperty = (property) => {
512-
return Reflect.has(appRef, property)
513-
}
514510
console.warn = warnSave
515511
const wrapper = createVueWrapper(app, appRef, setProps)
516512
trackInstance(wrapper)

0 commit comments

Comments
 (0)