如何清除Jest缓存? [英] How to clear Jest cache?

查看:793
本文介绍了如何清除Jest缓存?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Jest正在获取软件包的旧版本,因此除非使用--no-cache,否则我的测试将失败.我什至可以从node_modules删除package文件夹,Jest很高兴运行测试(几乎所有通过的测试).

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).

那我如何清除Jest缓存?

So how do I clear Jest cache?

推荐答案

您可以通过运行

You can find the cache location by running jest --showConfig. Look for cacheDirectory key. Its value is the name of the folder you'll need to remove.

这篇关于如何清除Jest缓存?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆