Run only certain mocha test:

Image for a hint

Suppose you have tests structured by describe sections:

describe('group1', function () {
   describe('subgrp1', function () {
      it('name1', function (done) {

Filter tests when run

npm run test -- -g 'name1'
npm run test -- -g 'group1'
npm run test -- -g 'subgrp1'

with next in package.json:

"scripts": {
   "test": "mocha"

or just without npm

mocha -g "name1"
#npm #mocha
Ivan Borshchov profile picture
Apr 13, 2017
by Ivan Borshchov
Did it help you?
Yes !

Best related