Skip to content

Commit a07dd35

Browse files
committed
docs: updated cli-plugin jest config section
1 parent fd16a0e commit a07dd35

File tree

2 files changed

+39
-2
lines changed

2 files changed

+39
-2
lines changed

content/graphql/cli-plugin.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,27 @@ With this in place, import AST transformer within your `jest` configuration file
182182
"globals": {
183183
"ts-jest": {
184184
"astTransformers": {
185-
"before": ["<path to the file created above>"],
185+
"before": ["<path to the file created above>"]
186186
}
187187
}
188188
}
189189
}
190190
```
191+
192+
If you use jest v29, then use the snippet below, as the previous approach got deprecated.
193+
194+
```json
195+
{
196+
... // other configuration
197+
"transform": {
198+
"^.+\\.(t|j)s$": [
199+
"ts-jest",
200+
{
201+
"astTransformers": {
202+
"before": ["<path to the file created above>"]
203+
}
204+
}
205+
]
206+
}
207+
}
208+
```

content/openapi/cli-plugin.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,13 +223,32 @@ With this in place, import AST transformer within your `jest` configuration file
223223
"globals": {
224224
"ts-jest": {
225225
"astTransformers": {
226-
"before": ["<path to the file created above>"],
226+
"before": ["<path to the file created above>"]
227227
}
228228
}
229229
}
230230
}
231231
```
232232

233+
If you use jest v29, then use the snippet below, as the previous approach got deprecated.
234+
235+
```json
236+
{
237+
... // other configuration
238+
"transform": {
239+
"^.+\\.(t|j)s$": [
240+
"ts-jest",
241+
{
242+
"astTransformers": {
243+
"before": ["<path to the file created above>"]
244+
}
245+
}
246+
]
247+
}
248+
}
249+
```
250+
251+
233252
#### Troubleshooting `jest` (e2e tests)
234253

235254
In case `jest` does not seem to pick up your configuration changes, it's possible that Jest has already **cached** the build result. To apply the new configuration, you need to clear Jest's cache directory.

0 commit comments

Comments
 (0)