Silent error when a test file can't be loaded
See original GitHub issueHi,
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.
Issue Analytics
- State:
 - Created 7 years ago
 - Reactions:6
 - Comments:19 (11 by maintainers)
 
Top Results From Across the Web
No Test Found · Issue #16982 · microsoft/playwright - GitHub
When there's some error in the implementation, the plugin simply can't find the test without any message, this could be confused sometimes.
Read more >Stop huge error output from testing-library - Stack Overflow
I would say the best solution would be to use the configure method and pass a custom function for getElementError which does what...
Read more >How do I suppress error messages from cp?
To suppress error output in bash , append 2>/dev/null to the end of your command. This redirects filehandle 2 (STDERR) to /dev/null ....
Read more >How do I solve the TypeLoadException Error in unit testing
I am getting an error when trying to run a unit test. It says System.TypeLoadException: Could not load type 'Parsers.
Read more >How to resolve cases of Visual Studio “No tests appearing”
Visual Studio only comes with the old MSTest 1 adapter installed. ... unfortunately it does so silently, that is by not showing any...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

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.
Has this been fixed? I’m running v0.9.16 and i’m still getting silent failures to load tests. Running individual tests does give a failure, but running groups doesn’t.