Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update to jest 27 #811

Merged
merged 2 commits into from Feb 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion jest.config.js
Expand Up @@ -12,7 +12,7 @@ module.exports = {
},
testEnvironment: 'jsdom',
transform: {
'^.+\\.vue$': 'vue-jest',
'^.+\\.vue$': '@vue/vue3-jest',
'^.+\\js$': 'babel-jest'
},
moduleFileExtensions: ['vue', 'js', 'json', 'jsx', 'ts', 'tsx', 'node'],
Expand Down
9 changes: 5 additions & 4 deletions package.json
Expand Up @@ -26,10 +26,11 @@
"@vue/compat": "3.2.31",
"@vue/compiler-dom": "3.2.31",
"@vue/compiler-sfc": "3.2.31",
"babel-jest": "^26.6.3",
"babel-preset-jest": "^27.5.1",
"@vue/vue3-jest": "27.0.0-alpha.4",
"babel-jest": "27.1.0",
"babel-preset-jest": "27.0.6",
"husky": "^7.0.4",
"jest": "25.5.4",
"jest": "27.5.1",
"jsdom": "^19.0.0",
"jsdom-global": "^3.0.2",
"lint-staged": "^12.3.3",
Expand All @@ -38,7 +39,7 @@
"reflect-metadata": "^0.1.13",
"rollup": "^2.67.2",
"rollup-plugin-typescript2": "^0.31.2",
"ts-jest": "25.3.1",
"ts-jest": "27.1.3",
"tslib": "2.3.1",
"typescript": "4.5.5",
"vitepress": "^0.22.0",
Expand Down
3 changes: 2 additions & 1 deletion src/mount.ts
Expand Up @@ -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)
}
Expand Down