Skip to content

Commit

Permalink
jest-worker test: add FORCE_COLOR env var
Browse files Browse the repository at this point in the history
  • Loading branch information
spion committed Nov 23, 2018
1 parent 4d31ae0 commit 7c83449
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/jest-worker/src/__tests__/Worker.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
/* eslint-disable no-new */

import EventEmitter from 'events';
import supportsColor from 'supports-color';

import {
CHILD_MESSAGE_CALL,
Expand Down Expand Up @@ -64,7 +65,9 @@ it('passes fork options down to child_process.fork, adding the defaults', () =>
expect(childProcess.fork.mock.calls[0][0]).toBe(child);
expect(childProcess.fork.mock.calls[0][1]).toEqual({
cwd: '/tmp', // Overridden default option.
env: process.env, // Default option.
env: Object.assign({}, process.env, {
FORCE_COLOR: (supportsColor.stdout && '1') || undefined,
}), // Default option.
execArgv: ['-p'], // Filtered option.
execPath: 'hello', // Added option.
silent: true, // Default option.
Expand Down

0 comments on commit 7c83449

Please sign in to comment.