faq labelnode node_modules/.bin/mocha --version(Local) and mocha --version(Global). We recommend that you _not_ install Mocha globally.Since the upgrade to mocha 6 my tests no longer work. I ensures that it wasn't any other package update that caused this issue by keeping all my dependencies identical except mocha 5 / 6.
The configuration I use in `mocha.opts' is as follows:
--recursive
--require ts-node/register
--exit
test/**/*.ts
The error I get from running ./node_modules/.bin/mocha is 'No test files found
I realize that this issue might not be caused by mocha, but it seemed like a good first place to ask. Could something have changed that would cause something like ts-node to fail?
It's a 6.0 bug (#3763), fix is in process.
Workaround until then by repeating the spec glob:
{
"scripts": {
"test": "mocha 'test/**/*.ts'"
}
}
Thanks for the quick response. Super appreciate this project!
I have a similar kind of problem. Please take a look at the following link.
https://stackoverflow.com/questions/64173341/unable-to-find-server-js-file-while-testing-with-mocha
This still exists today unfortunately.
It doesn't, I use this configuration and it's perfect:
"mocha": {
"require": [
"ts-node/register",
],
"recursive": true,
"extension": [
"ts",
"js",
"tsx"
],
}
Oh, I'm sorry. I didn't mean to necrobump this, especially since it's not the right issue I was looking at 馃槩
Thanks for replying and adding your example!
Most helpful comment
It's a 6.0 bug (#3763), fix is in process.
Workaround until then by repeating the spec glob:
"package.json":