Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More helpful message when test path not found #759

jtlapp opened this issue Sep 25, 2017 · 0 comments

More helpful message when test path not found #759

jtlapp opened this issue Sep 25, 2017 · 0 comments


Copy link

@jtlapp jtlapp commented Sep 25, 2017

I'll be following up with a PR

I happened to have a library file called test.js and my tests in a directory called tests/. When lab spat out the following error, I went investigating test.js, particularly because I usually exclude the filename extension from my module requires.:


Error: ENOENT: no such file or directory, stat 'test'
    at Object.fs.statSync (fs.js:954:11)
    at traverse (/usr/local/lib/node_modules/lab/lib/cli.js:73:29)
    at paths.forEach (/usr/local/lib/node_modules/lab/lib/cli.js:103:38)
    at Array.forEach (<anonymous>)
    at Object.internals.traverse (/usr/local/lib/node_modules/lab/lib/cli.js:101:11)
    at (/usr/local/lib/node_modules/lab/lib/cli.js:62:31)
    at Object.<anonymous> (/usr/local/lib/node_modules/lab/bin/lab:50:23)
    at Module._compile (module.js:573:30)
    at Object.Module._extensions..js (module.js:584:10)
    at Module.load (module.js:507:32)
    at tryModuleLoad (module.js:470:12)
    at Function.Module._load (module.js:462:3)
    at Function.Module.runMain (module.js:609:10)
    at startup (bootstrap_node.js:158:16)
    at bootstrap_node.js:598:3

The problem was that I'd forgotten to specify the test path, as in lab tests. I guess I was also inclined to believe that uncaught exceptions would be thrown from my code, representing problems with the code.

The solution to the problem is easy: just have lab report a friendly error message that makes the problem clear. Okay, now to submit the PR.

@geek geek added the bug label Sep 26, 2017
@geek geek added this to the 14.3.2 milestone Sep 26, 2017
@geek geek self-assigned this Sep 26, 2017
@geek geek closed this Sep 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.