nightwatch: Silent error when a test file can't be loaded
Hi,
It took me a while to figure out why I could not load some tests.
I had a wrong require in one of my test, which issued an error like this:
{ [Error: Cannot find module '../../../utils/config'] code: 'MODULE_NOT_FOUND' }
My problem is that Nightwatch is silencing this error with a try-catch: https://github.com/nightwatchjs/nightwatch/blob/c5e3d24eae6d705729747ddf597c129e1c10c48d/lib/runner/filematcher.js#L38
It is a lot of time wasted as I didn’t think the problem was in one of my files. It is not a good idea to silent any error in this type of library.
Would you be happy to at least log this error? Or even interrupt the suit? I’m happy to do a PR, just advice what you think would be best.
Cheers.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 6
- Comments: 19 (11 by maintainers)
I’m still on the side of causing the error, even for existing implementations depending on the existing behavior. A test not running - and possibly not even knowing its not running - is a critical failure. There’s a false sense of security there and when people update, they should be made aware that a test they thought was running was actually getting ignored.