Skip to content

Commit 23b8c47

Browse files
committed
Run workers with user supplied command line arguments
Fixes #1393.
1 parent c4c5e7b commit 23b8c47

File tree

4 files changed

+1
-30
lines changed

4 files changed

+1
-30
lines changed

lib/fork.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ module.exports = (file, opts, execArgv) => {
3636
} : false
3737
}, opts);
3838

39-
const args = [JSON.stringify(opts), opts.color ? '--color' : '--no-color'];
39+
const args = [JSON.stringify(opts)].concat(process.argv.slice(2));
4040

4141
const ps = childProcess.fork(path.join(__dirname, 'test-worker.js'), args, {
4242
cwd: opts.projectDir,

test/fixture/chalk-disabled.js

Lines changed: 0 additions & 6 deletions
This file was deleted.

test/fixture/chalk-enabled.js

Lines changed: 0 additions & 6 deletions
This file was deleted.

test/fork.js

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -134,20 +134,3 @@ test('babelrc is ignored', t => {
134134
t.end();
135135
});
136136
});
137-
138-
test('color support is initialized correctly', t => {
139-
t.plan(1);
140-
141-
return Promise.all([
142-
fork(fixture('chalk-enabled.js'), {color: true}).run({}),
143-
fork(fixture('chalk-disabled.js'), {color: false}).run({}),
144-
fork(fixture('chalk-disabled.js'), {}).run({})
145-
]).then(info => {
146-
info.forEach(info => {
147-
if (info.stats.failCount > 0) {
148-
throw new Error(`${info.file} failed`);
149-
}
150-
});
151-
t.is(info.length, 3);
152-
});
153-
});

0 commit comments

Comments
 (0)