diff --git a/tasks/gulp-tests.js b/tasks/gulp-tests.js index 580372adc7..e6c9e6e9bc 100644 --- a/tasks/gulp-tests.js +++ b/tasks/gulp-tests.js @@ -19,7 +19,7 @@ let testCount = (stdout, regexp) => { } let testBin = (string) => { - return `NODE_ENV=testing ./node_modules/.bin/${string}`; + return `NODE_ENV=testing $(npm bin)/${string}`; }; gulp.task('test:prepare:mongo', (cb) => { @@ -106,7 +106,7 @@ gulp.task('test:server_side:safe', ['test:prepare:build'], (cb) => { gulp.task('test:api-legacy', ['test:prepare:mongo'], (cb) => { let runner = exec( - testBin("istanbul cover -i 'website/src/**' --dir coverage/api-legacy ./node_modules/.bin/_mocha -- test/api-legacy"), + testBin("istanbul cover -i 'website/src/**' --dir coverage/api-legacy $(npm bin)/mocha -- test/api-legacy"), (err, stdout, stderr) => { cb(err); } @@ -116,7 +116,7 @@ gulp.task('test:api-legacy', ['test:prepare:mongo'], (cb) => { gulp.task('test:api-legacy:safe', ['test:prepare:mongo'], (cb) => { let runner = exec( - testBin("istanbul cover -i 'website/src/**' --dir coverage/api-legacy ./node_modules/.bin/_mocha -- test/api-legacy"), + testBin("istanbul cover -i 'website/src/**' --dir coverage/api-legacy $(npm bin)/mocha -- test/api-legacy"), (err, stdout, stderr) => { testResults.push({ suite: 'API (legacy) Specs',