Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hapi Lab why Test failed when all the tests are passed

Tags:

lab

hapi.js

Does anyone know the meaning of ?

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.

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! Test failed. See above for more details.

like image 964
Whisher Avatar asked Aug 03 '15 14:08

Whisher


2 Answers

The test fails because lab detected a global variable leak:

The following leaks were detected:lr

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

like image 92
Gergo Erdosi Avatar answered Nov 10 '22 12:11

Gergo Erdosi


I resolved this by deleting my node_modules folder and running "npm install" again since my major versions of both node & npm had changed.

like image 1
PaulAndrewLang Avatar answered Nov 10 '22 12:11

PaulAndrewLang