Jest is picking up an old version of a package and thus my tests fail unless I use --no-cache
. I can even delete the package folder from node_modules
and Jest is happy to run the tests (almost all passing).
So how do I clear Jest cache?
As of Jest 22.0.0+, you can use the --clearCache
option:
Deletes the Jest cache directory and then exits without running tests. Will delete cacheDirectory if the option is passed, or Jest's default cache directory.
For easy reference (as per @Beraliv): https://facebook.github.io/jest/docs/en/cli.html#clearcache