Skip to content

Commit

Permalink
color env in vite helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
markdalgleish committed Mar 8, 2024
1 parent f0b1bb9 commit 99b6c03
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions integration/helpers/vite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,14 @@ export async function createProject(
return projectDir;
}

// Avoid "Warning: The 'NO_COLOR' env is ignored due to the 'FORCE_COLOR' env
// being set" in vite-ecosystem-ci which breaks empty stderr assertions. To fix
// this we always ensure that only NO_COLOR is set after spreading process.env.
const colorEnv = {
FORCE_COLOR: undefined,
NO_COLOR: "1",
} as const;

export const viteBuild = ({
cwd,
env = {},
Expand All @@ -129,9 +137,8 @@ export const viteBuild = ({
cwd,
env: {
...process.env,
...colorEnv,
...env,
FORCE_COLOR: undefined,
NO_COLOR: "1",
},
});
};
Expand Down Expand Up @@ -316,6 +323,7 @@ function node(
cwd: options.cwd,
env: {
...process.env,
...colorEnv,
...options.env,
},
stdio: "pipe",
Expand Down

0 comments on commit 99b6c03

Please sign in to comment.