Browse Source

fix: missing linux server env for tests

Co-authored-by: deepak1556 <[email protected]>
trop[bot] 3 weeks ago
parent
commit
ad38eec346
1 changed files with 7 additions and 2 deletions
  1. 7 2
      spec/crash-spec.ts

+ 7 - 2
spec/crash-spec.ts

@@ -10,9 +10,14 @@ const fixturePath = path.resolve(__dirname, 'fixtures', 'crash-cases');
 
 let children: cp.ChildProcessWithoutNullStreams[] = [];
 
-const runFixtureAndEnsureCleanExit = async (args: string[], env: NodeJS.ProcessEnv) => {
+const runFixtureAndEnsureCleanExit = async (args: string[], customEnv: NodeJS.ProcessEnv) => {
   let out = '';
-  const child = cp.spawn(process.execPath, args, { env });
+  const child = cp.spawn(process.execPath, args, {
+    env: {
+      ...process.env,
+      ...customEnv
+    }
+  });
   children.push(child);
   child.stdout.on('data', (chunk: Buffer) => {
     out += chunk.toString();