Skip to content

Commit

Permalink
Use the local Mocha dependency of this package
Browse files Browse the repository at this point in the history
So it no longer requires having Mocha installed globally
  • Loading branch information
sindresorhus committed Mar 7, 2017
1 parent bf30380 commit 915351f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ const dargs = require('dargs');
const execa = require('execa');
const gutil = require('gulp-util');
const through = require('through2');
// TODO: Use execa localDir option when available
const npmRunPath = require('npm-run-path');

module.exports = opts => {
opts = Object.assign({
Expand Down Expand Up @@ -38,7 +40,9 @@ module.exports = opts => {
}

function flush(done) {
let proc = execa('mocha', files.concat(args));
const env = npmRunPath.env({cwd: __dirname});
const proc = execa('mocha', files.concat(args), {env});

proc.then(result => {
this.emit('_result', result);
done();
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"execa": "^0.6.0",
"gulp-util": "^3.0.0",
"mocha": "^3.0.0",
"npm-run-path": "^2.0.2",
"through2": "^2.0.3"
},
"devDependencies": {
Expand Down

0 comments on commit 915351f

Please sign in to comment.