I use Mocha to test my JavaScript stuff. My test file contains 5 tests. Is that possible to run a specific test (or set of tests) rather than all the tests in the file?
If you are using npm test (using package.json scripts) use an extra -- to pass the param through to mocha
e.g. npm test -- --grep "my second test"
EDIT: Looks like --grep can be a little fussy (probably depending on the other arguments). You can:
Modify the package.json:
"test:mocha": "mocha --grep \" \" .",
Or alternatively use --bail which seems to be less fussy
npm test -- --bail