Skip to content

Commit d5e23bd

Browse files
author
vivek-gofynd
committed
Fix Jest transforms for Vue and ESM deps.
Add Babel runtime helpers and allow url-join transforms so tests run cleanly.
1 parent eed9ab7 commit d5e23bd

File tree

4 files changed

+15
-2
lines changed

4 files changed

+15
-2
lines changed

babel.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
module.exports = {
22
presets: [
33
['@babel/preset-env', { targets: { node: 'current' } }]
4-
]
4+
],
5+
plugins: ['@babel/plugin-transform-runtime']
56
}

jest.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ module.exports = {
1111
testEnvironmentOptions: {
1212
customExportConditions: ["node", "node-addons"],
1313
},
14+
transformIgnorePatterns: ["/node_modules/(?!(url-join)/)"],
1415
moduleFileExtensions: ["js", "vue", "json"],
1516
collectCoverage: true,
1617
collectCoverageFrom: [

package-lock.json

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,11 @@
1919
"devDependencies": {
2020
"@babel/core": "^7.28.6",
2121
"@babel/eslint-parser": "^7.28.6",
22-
"@babel/plugin-transform-optional-chaining": "^7.28.6",
2322
"@babel/plugin-syntax-dynamic-import": "7.8.3",
23+
"@babel/plugin-transform-optional-chaining": "^7.28.6",
2424
"@babel/plugin-transform-runtime": "^7.28.5",
2525
"@babel/preset-env": "^7.28.6",
26+
"@babel/runtime": "^7.28.6",
2627
"@vitejs/plugin-vue": "^6.0.3",
2728
"@vue/test-utils": "^2.4.6",
2829
"@vue/vue3-jest": "^29.2.6",

0 commit comments

Comments
 (0)