Skip to content

Commit c9b82b1

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 226d3f1 commit c9b82b1

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
@@ -50,7 +50,13 @@
5050
"vuex": "^4.0.2"
5151
},
5252
"peerDependencies": {
53-
"vue": "^3.0.1"
53+
"vue": "^3.0.1",
54+
"jest": "^27.1.0"
55+
},
56+
"peerDependenciesMeta": {
57+
"jest": {
58+
"optional": true
59+
}
5460
},
5561
"author": {
5662
"name": "Lachlan Miller",

src/mount.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -464,10 +464,6 @@ export function mount(
464464
// if not, use the return value from app.mount.
465465
const appRef = vm.$refs[MOUNT_COMPONENT_REF] as ComponentPublicInstance
466466
const $vm = Reflect.ownKeys(appRef).length ? appRef : vm
467-
// we add `hasOwnProperty` so jest can spy on the proxied vm without throwing
468-
$vm.hasOwnProperty = (property) => {
469-
return Reflect.has($vm, property)
470-
}
471467
console.warn = warnSave
472468
return createWrapper(app, $vm, setProps)
473469
}

0 commit comments

Comments
 (0)