本文介绍了Hapi Lab为什么通过所有测试后测试失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有人知道吗?
3 tests complete
Test duration: 873 ms
The following leaks were detected:lr
npm ERR! Test failed. See above for more details.
我进行了3次测试成功的绿色3次测试完成(我所有的测试都通过了)但是为什么我也看到讨厌的东西?
I run my 3 tests I geta successful green 3 tests complete(all my test are passed)but why I also see the nasty ?
推荐答案
测试失败,因为lab
检测到全局变量泄漏:
The test fails because lab
detected a global variable leak:
这意味着您可能将lr
变量定义为全局变量.尝试找到您在哪里执行的操作并将变量设置为局部变量.另一个选项是使用 -l
选项运行lab
,该选项将禁用全局变量泄漏检测(它是不过不推荐).
This means you probably defined the lr
variable somewhere as global. Try to find where you did that and make the variable local. The other option is to run lab
with the -l
option which disables global variable leak detection (it is not recommended though).
这篇关于Hapi Lab为什么通过所有测试后测试失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!