question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Silent error when a test file can't be loaded

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:6
  • Comments:19 (11 by maintainers)

github_iconTop GitHub Comments

3reactions
senocularcommented, Oct 1, 2016

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.

0reactions
calderonrobertocommented, Jun 14, 2017

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found