chevin99
chevin99

Reputation: 5088

NPM Concurrently not running mocha test

I am using the npm package concurrently to run multiple processes needed for a test.

When I run mocha alone like this:

./node_modules/mocha/bin/mocha  --harmony ./tests/

it works fine. But when I try to use it with concurrently like this:

./node_modules/concurrently/src/main.js "./node_modules/mocha/bin/mocha  --harmony ./tests/"

I get an error like this:

throw new Error("must provide pattern")
[0]           ^
[0] Error: must provide pattern
[0]     at new Glob (/Users/my-project/node_modules/mocha/node_modules/glob/glob.js:121:11)

Upvotes: 0

Views: 234

Answers (1)

chevin99
chevin99

Reputation: 5088

It worked by adding the mocha part as a script in package.json

"scripts": { "mocha": "./node_modules/mocha/bin/mocha --harmony ./tests/" },

and then this:

./node_modules/concurrently/src/main.js "npm run mocha"

Upvotes: 1

Related Questions