Skip to content

Commit 2f919fe

Browse files
committed
trying to get jest to work
1 parent 281a013 commit 2f919fe

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

.babelrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
}]
99
],
1010
"plugins": [
11+
'@babel/plugin-transform-modules-commonjs',
1112
"transform-object-rest-spread"
1213
]
1314
}

babel.config.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
module.exports = {
2+
"presets": [
3+
["@babel/preset-env", {
4+
"useBuiltIns": "entry",
5+
"targets": {
6+
"node": "current"
7+
}
8+
}]
9+
],
10+
"plugins": [
11+
'@babel/plugin-transform-modules-commonjs',
12+
"transform-object-rest-spread"
13+
]
14+
}

jest.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ module.exports = {
1212
"json",
1313
"vue"
1414
],
15+
transformIgnorePatterns: ['node_modules/(?!(nanoid)/)'],
1516
transform: {
1617
".*\\.(vue)$": "@vue/vue3-jest",
1718
"^.+\\.js$": "babel-jest"
@@ -31,4 +32,4 @@ module.exports = {
3132
moduleNameMapper: {
3233
'\\.(css|less)$': '<rootDir>/tests/testMocks.js'
3334
}
34-
}
35+
}

0 commit comments

Comments
 (0)