Skip to content

Commit 1677f7e

Browse files
committed
docs(@nestjs/swagger): jest troubleshooting info
Add instruction on how to clear the jest cache folder in case changes are not picked up fixes: nestjs/swagger#1326
1 parent 3d4a791 commit 1677f7e

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

content/openapi/cli-plugin.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,3 +197,21 @@ With this in place, import AST transformer within your `jest` configuration file
197197
}
198198
}
199199
```
200+
201+
#### Troubleshooting `jest` (e2e tests)
202+
In any case that `jest` does not seem to pick up your configuration changes, it is quite possible that it has already **cached** the build result. In order for your changes _(`@nestjs/swagger/plugin` integration)_, to be taken into account, you need to clear its cache directory.
203+
204+
In order to clear the cache directory of `jest`, run the following commands:
205+
```bash
206+
# Find out jest cache directory (usually /tmp/jest_rs)
207+
# by running command below in your NestJS project root
208+
$ npx jest --showConfig | grep cache
209+
# ex result:
210+
# "cache": true,
211+
# "cacheDirectory": "/tmp/jest_rs"
212+
213+
# Remove or empty the found Jest cache directory
214+
$ rm -rf <cacheDirectory value>
215+
# ex:
216+
# rm -rf /tmp/jest_rs
217+
```

0 commit comments

Comments
 (0)