简体   繁体   English

与启动酶单元测试的反应代码相关的任何警告都不能通过测试而不是仅显示警告

[英]Any warnings related to react code for jest enzyme unit tests fails the tests instead of just displaying the warning

I have recently done jest enzyme configuration for my react project. 我最近为我的反应项目做了开胃酶配置。 The issue is any warning from react code causes my test cases to fail. 问题是反应代码的任何警告都会导致我的测试用例失败。 Is there any way I can do the jest enzyme configuration so that my tests runs even when there is some warning? 我有什么方法可以进行游戏酶配置,这样即使有警告我的测试也会运行吗? My code is fully functional and I want to ignore warnings for my tests and just want my test cases to run instead of failing immediately whenever any small warning comes. 我的代码功能齐全,我想忽略我的测试警告,只是希望我的测试用例运行,而不是在出现任何小警告时立即失败。

To disable warning, you can use the --silent flag. 要禁用警告,可以使用--silent标志。 So run your tests with jest --silent . 所以用jest --silent运行你的测试。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM