Jest: How to clear the cache

Posted Over 2 years ago. Visible to the public.

I recently was in a weird situation where my (Jest/CLI) tests were referencing a function that was no longer part of my code - I had just refactored it.

Apparently Jest has some kind of cache that caused the issue, running npx jest --clearCache solved it for me.

Michael Leimstädtner
Last edit
Over 2 years ago
Michael Leimstädtner
Keywords
vue-cli-service, test:unit, yarn, test
License
Source code in this card is licensed under the MIT License.
Posted by Michael Leimstädtner to makandra dev (2022-02-02 10:51)