Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
snayan opened this issue Mar 25, 2020 · 0 comments
Open

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

snayan opened this issue Mar 25, 2020 · 0 comments

Comments

@snayan
Copy link

snayan commented Mar 25, 2020

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
 });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant