Skip to content

Commit e764480

Browse files
committed
test: disable color in test config
1 parent 9b2706d commit e764480

3 files changed

Lines changed: 4 additions & 31 deletions

File tree

packages/rstack/rstack.config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import { define } from 'rstack';
22

3+
// Disable color in test
4+
process.env.NO_COLOR = '1';
5+
36
define.test({
47
source: {
58
tsconfigPath: './test/tsconfig.json',

packages/rstack/test/cli/help/index.test.ts

Lines changed: 0 additions & 17 deletions
This file was deleted.

packages/rstack/test/cli/staged/index.test.ts

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { execFileSync } from 'node:child_process';
22
import { mkdtemp, rm, writeFile } from 'node:fs/promises';
33
import path from 'node:path';
4-
import { stripVTControlCharacters } from 'node:util';
54
import { test } from '#test-helpers';
65

76
const git = (cwd: string, args: string[]): void => {
@@ -64,7 +63,7 @@ const withGitFixture = async (callback: (cwd: string) => Promise<void> | void):
6463
};
6564

6665
test('should display the staged help message', ({ execCli, expect }) => {
67-
const output = stripVTControlCharacters(execCli('staged --help'));
66+
const output = execCli('staged --help');
6867

6968
expect(output).toContain('Rstack v');
7069
expect(output).toContain('Usage:\n $ rs staged [options]');
@@ -79,18 +78,6 @@ test('should display the staged help message', ({ execCli, expect }) => {
7978
expect(output).toContain('-h, --help');
8079
});
8180

82-
test('should display the colorized staged help message', ({ execCli, expect }) => {
83-
const output = execCli('staged -h', {
84-
env: {
85-
FORCE_COLOR: '1',
86-
},
87-
});
88-
89-
expect(output).toContain('\x1b[36mUsage\x1b[39m:');
90-
expect(output).toContain('\x1b[33m $ rs staged [options]\x1b[39m');
91-
expect(output).toContain('\x1b[36mOptions\x1b[39m:');
92-
});
93-
9481
test('should reject unknown staged options', ({ execCli, expect }) => {
9582
expect(() => execCli('staged --unknown')).toThrow();
9683
});

0 commit comments

Comments
 (0)