Skip to content

process.env.NODE_ENV can not pass to child process  #86

@snayan

Description

@snayan

when i use jest.run to run my tests, thread-loader can not pass process.env.NODE_ENV to child process. i print process.env.NODE_ENV in main process and child process, such as

image

explicit pass env,child process will get the correct process.env.NODE_ENV

this.worker = childProcess.spawn(process.execPath, [].concat(sanitizedNodeArgs).concat(workerPath, options.parallelJobs), {
    detached: true,
    stdio: ['ignore', 'pipe', 'pipe', 'pipe', 'pipe'],
    env: process.env
 });

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions