I currently run mocha tests with npm scripts like
mocha test/mocha.js test/crc/mocha.js test/multibyte/test.js
I added an additional three test files and I started to think maybe to use a configuration file like .mocharc.js, and call simply mocha, but whatever I try, mocha always runs all .js files in "test" folder.
file property, but it won't work.watch-files property but it still won't work.file property, but it won't work.All this is so confusing and I can't find any config file documentation more than what file names I should use.
Does anyone knows how I can run just these three test-files with a config file ?
I know I can use npm script like before, but maybe there is way ?
You can use spec:
.mocharc.json:
{
"spec": "./test/**/*.js"
}
Some other examples are in here: How to specify test directory for mocha?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With