Skip to content

Commit b512ac7

Browse files
authored
test(cli): force plain text when comparing output (#909)
1 parent afb2105 commit b512ac7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Diff for: @commitlint/cli/src/cli.test.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,8 @@ test('should handle linting with issue prefixes', async () => {
329329
test('should print full commit message when input from stdin fails', async () => {
330330
const cwd = await gitBootstrap('fixtures/simple');
331331
const input = 'foo: bar\n\nFoo bar bizz buzz.\n\nCloses #123.';
332-
const actual = await cli([], {cwd})(input);
332+
// output text in plain text so we can compare it
333+
const actual = await cli(['--color=false'], {cwd})(input);
333334

334335
expect(actual.stdout).toContain(input);
335336
expect(actual.code).toBe(1);
@@ -338,7 +339,8 @@ test('should print full commit message when input from stdin fails', async () =>
338339
test('should not print commit message fully or partially when input succeeds', async () => {
339340
const cwd = await gitBootstrap('fixtures/default');
340341
const message = 'type: bar\n\nFoo bar bizz buzz.\n\nCloses #123.';
341-
const actual = await cli([], {cwd})(message);
342+
// output text in plain text so we can compare it
343+
const actual = await cli(['--color=false'], {cwd})(message);
342344

343345
expect(actual.stdout).not.toContain(message);
344346
expect(actual.stdout).not.toContain(message.split('\n')[0]);

0 commit comments

Comments
 (0)