Skip to content

Commit

Permalink
test: add path to nodeJs when running test:bin
Browse files Browse the repository at this point in the history
- this allows the test to be run in a debugger
  without the complete PATH
  • Loading branch information
nknapp committed Jan 8, 2020
1 parent 461b837 commit e0b349c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tasks/test-bin.js
@@ -1,6 +1,7 @@
const childProcess = require('child_process');
const fs = require('fs');
const os = require('os');
const path = require('path');

const chai = require('chai');
chai.use(require('chai-diff'));
Expand Down Expand Up @@ -37,7 +38,13 @@ function executeBinHandlebars(...args) {
}

function execFilesSyncUtf8(command, args) {
return childProcess.execFileSync(command, args, { encoding: 'utf-8' });
const env = process.env;
env.PATH = addPathToNodeJs(env.PATH);
return childProcess.execFileSync(command, args, { encoding: 'utf-8', env });
}

function addPathToNodeJs(pathEnvironment) {
return path.dirname(process.argv0) + path.delimiter + pathEnvironment;
}

function normalizeCrlf(string) {
Expand Down

0 comments on commit e0b349c

Please sign in to comment.