Hapi Lab为什么通过所有测试后测试失败 [英] Hapi Lab why Test failed when all the tests are passed
问题描述
有人知道吗?
npm ERR!测试失败.有关更多详细信息,请参见上文.
npm ERR! Test failed. See above for more details.
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 get a successful green 3 tests complete (all my test are passed) but why I also see the nasty ?
npm ERR!测试失败.有关更多详细信息,请参见上文.
npm ERR! Test failed. See above for more details.
推荐答案
测试失败,因为lab
检测到全局变量泄漏:
The test fails because lab
detected a global variable leak:
检测到以下泄漏:lr
The following leaks were detected:lr
这意味着您可能将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为什么通过所有测试后测试失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!