You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+51Lines changed: 51 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -85,6 +85,57 @@ To define a babelrc file that vue-jest will use when transpiling javascript, you
85
85
}
86
86
```
87
87
88
+
You can also directly supply babel configuration
89
+
90
+
```json
91
+
{
92
+
"jest": {
93
+
"globals": {
94
+
"vue-jest": {
95
+
"babelConfig": {
96
+
"presets": [
97
+
[
98
+
"env",
99
+
{
100
+
"useBuiltIns": "entry",
101
+
"shippedProposals": true
102
+
}
103
+
]
104
+
],
105
+
"plugins": [
106
+
"syntax-dynamic-import"
107
+
],
108
+
"env": {
109
+
"test": {
110
+
"plugins": [
111
+
"dynamic-import-node"
112
+
]
113
+
}
114
+
}
115
+
}
116
+
}
117
+
}
118
+
}
119
+
}
120
+
```
121
+
122
+
This can be used to support a [project-wide configuration](https://babeljs.io/docs/en/config-files#project-wide-configuration) file:
123
+
124
+
```json
125
+
{
126
+
"jest": {
127
+
"globals": {
128
+
"vue-jest": {
129
+
"babelConfig": {
130
+
"configFile": "/path/to/babel.config.js"
131
+
}
132
+
}
133
+
}
134
+
}
135
+
}
136
+
```
137
+
> *Tip:* Need programmatic configuration? Use the [--config](https://jestjs.io/docs/en/cli.html#config-path) option in Jest CLI, and export a `.js` file
0 commit comments