Skip to content

Commit 6c4db25

Browse files
authored
fix: fix jest migrator dependency merging (#6454)
Thanks to @PiDelport
1 parent 890e1e9 commit 6c4db25

File tree

1 file changed

+4
-3
lines changed
  • packages/@vue/cli-plugin-unit-jest/migrator

1 file changed

+4
-3
lines changed
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/** @param {import('@vue/cli/lib/MigratorAPI')} api MigratorAPI */
22
module.exports = (api) => {
33
api.extendPackage(pkg => {
4-
const toMerge = {}
4+
const newDevDeps = {}
55

66
const allDeps = {
77
...pkg.dependencies,
@@ -12,13 +12,14 @@ module.exports = (api) => {
1212
if (!allDeps['vue-jest']) {
1313
// Likely a Vue 2 project, and uses the builtin preset.
1414
// Because we used to add `vue-jest` v5 to dev deps for Vue 3 projects.
15-
toMerge['vue-jest'] = '^4.0.1'
15+
newDevDeps['vue-jest'] = '^4.0.1'
1616
}
1717

1818
if (allDeps['@vue/cli-plugin-typescript'] && !allDeps['ts-jest']) {
19-
toMerge['ts-jest'] = '^26.5.3'
19+
newDevDeps['ts-jest'] = '^26.5.3'
2020
}
2121

22+
const toMerge = { devDependencies: newDevDeps }
2223
return toMerge
2324
})
2425
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy