-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Feature request: better error reporting when mocha can't find tests (getting started) #2194
Comments
I am also getting the same error, any update on this? |
Purely theoretically speaking, this doesn’t look like an exception, and we could handle it gracefully — I’m guessing just print an explanatory message to STDERR, and exit Node with non-zero status. 🤔 What do you guys think? 🤓 |
If several globs are provided (for e.g. with braced sections), mocha shouldn't exit with non-zero code or throw an error util all paths are checked for tests. Currently if I run mocha with a glob like |
…if no files are matched at all. Fixes #2194
How about this take on it? #2450 |
…if no files are matched at all. Fixes #2194
* Report non-matching patterns to STDERR and exit with non-zero status if no files are matched at all. Fixes #2194 * Code review changes
…2450) * Report non-matching patterns to STDERR and exit with non-zero status if no files are matched at all. Fixes mochajs#2194 * Code review changes
The getting started tutorial on the home page looks pretty simple, but if you put the test in a different directory than "test" it's suddenly not very friendly:
/usr/local/lib/node_modules/mocha/lib/utils.js:628
throw new Error("cannot resolve path (or pattern) '" + path + "'");
^
Error: cannot resolve path (or pattern) 'test'
at Object.lookupFiles (/usr/local/lib/node_modules/mocha/lib/utils.js:628:15)
at /usr/local/lib/node_modules/mocha/bin/_mocha:326:30
at Array.forEach (native)
at Object. (/usr/local/lib/node_modules/mocha/bin/_mocha:325:6)
at Module._compile (module.js:413:34)
at Object.Module._extensions..js (module.js:422:10)
at Module.load (module.js:357:32)
at Function.Module._load (module.js:314:12)
at Function.Module.runMain (module.js:447:10)
at startup (node.js:142:18)
at node.js:939:3
The text was updated successfully, but these errors were encountered: