Skip to content

Commit ad6f3dc

Browse files
Merge branch 'mitsos1os-ts-jest-swagger'
2 parents 801d772 + ff64da6 commit ad6f3dc

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

content/openapi/cli-plugin.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,3 +197,29 @@ With this in place, import AST transformer within your `jest` configuration file
197197
}
198198
}
199199
```
200+
201+
#### Troubleshooting `jest` (e2e tests)
202+
203+
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.
204+
205+
To clear the cache directory, run the following command in your NestJS project folder:
206+
207+
```bash
208+
$ npx jest --clearCache
209+
```
210+
211+
In case the automatic cache clearance fails, you can still manually remove the cache folder with the following commands:
212+
213+
```bash
214+
# Find jest cache directory (usually /tmp/jest_rs)
215+
# by running the following command in your NestJS project root
216+
$ npx jest --showConfig | grep cache
217+
# ex result:
218+
# "cache": true,
219+
# "cacheDirectory": "/tmp/jest_rs"
220+
221+
# Remove or empty the Jest cache directory
222+
$ rm -rf <cacheDirectory value>
223+
# ex:
224+
# rm -rf /tmp/jest_rs
225+
```

0 commit comments

Comments
 (0)