Skip to content

🎥 Make videos programmatically with React

Fix help tests with forced colors

JonnyBurgerd14dfa49428a
diff --git a/packages/cli/src/test/help.test.ts b/packages/cli/src/test/help.test.ts
index 897cd60528..1635b8be85 100644
--- a/packages/cli/src/test/help.test.ts
+++ b/packages/cli/src/test/help.test.ts
@@ -90,6 +90,8 @@ test('prints command-specific help without running the command', () => {
`throw new Error('The config file must not be loaded for --help');\n`,
);
const initialFiles = readdirSync(temporaryDirectory);
+ const childEnvironment: NodeJS.ProcessEnv = {...process.env, NO_COLOR: '1'};
+ delete childEnvironment.FORCE_COLOR;
try {
for (const {
@@ -104,7 +106,7 @@ test('prints command-specific help without running the command', () => {
{
cwd: temporaryDirectory,
encoding: 'utf8',
- env: {...process.env, NO_COLOR: '1'},
+ env: childEnvironment,
stdio: ['ignore', 'pipe', 'pipe'],
timeout: 10_000,
},
diff --git a/packages/cloudrun/src/test/cli-help.test.ts b/packages/cloudrun/src/test/cli-help.test.ts
index 302cc98535..1d4e42c795 100644
--- a/packages/cloudrun/src/test/cli-help.test.ts
+++ b/packages/cloudrun/src/test/cli-help.test.ts
@@ -119,6 +119,8 @@ test('the Remotion CLI delegates Cloud Run help before loading config', () => {
`throw new Error('The config file must not be loaded for --help');\n`,
);
const initialFiles = readdirSync(temporaryDirectory);
+ const childEnvironment: NodeJS.ProcessEnv = {...process.env, NO_COLOR: '1'};
+ delete childEnvironment.FORCE_COLOR;
try {
const result = spawnSync(
@@ -133,7 +135,7 @@ test('the Remotion CLI delegates Cloud Run help before loading config', () => {
{
cwd: temporaryDirectory,
encoding: 'utf8',
- env: {...process.env, NO_COLOR: '1'},
+ env: childEnvironment,
stdio: ['ignore', 'pipe', 'pipe'],
timeout: 10_000,
},
diff --git a/packages/lambda/src/test/unit/cli-help.test.ts b/packages/lambda/src/test/unit/cli-help.test.ts
index 007503bc18..8eacac02af 100644
--- a/packages/lambda/src/test/unit/cli-help.test.ts
+++ b/packages/lambda/src/test/unit/cli-help.test.ts
@@ -172,6 +172,8 @@ test('the Remotion CLI delegates Lambda help before loading config', () => {
`throw new Error('The config file must not be loaded for --help');\n`,
);
const initialFiles = readdirSync(temporaryDirectory);
+ const childEnvironment: NodeJS.ProcessEnv = {...process.env, NO_COLOR: '1'};
+ delete childEnvironment.FORCE_COLOR;
try {
const result = spawnSync(
@@ -186,7 +188,7 @@ test('the Remotion CLI delegates Lambda help before loading config', () => {
{
cwd: temporaryDirectory,
encoding: 'utf8',
- env: {...process.env, NO_COLOR: '1'},
+ env: childEnvironment,
stdio: ['ignore', 'pipe', 'pipe'],
timeout: 10_000,
},