From e82258d88b3e44370f7dfe5136c0df30c2aea0b0 Mon Sep 17 00:00:00 2001 From: Cedric van Putten Date: Sun, 26 Jan 2020 22:25:53 +0000 Subject: [PATCH] test(cli): force plain text when comparing output --- @commitlint/cli/src/cli.test.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/@commitlint/cli/src/cli.test.js b/@commitlint/cli/src/cli.test.js index 534e4c8e30..d5abe33dce 100644 --- a/@commitlint/cli/src/cli.test.js +++ b/@commitlint/cli/src/cli.test.js @@ -329,7 +329,8 @@ test('should handle linting with issue prefixes', async () => { test('should print full commit message when input from stdin fails', async () => { const cwd = await gitBootstrap('fixtures/simple'); const input = 'foo: bar\n\nFoo bar bizz buzz.\n\nCloses #123.'; - const actual = await cli([], {cwd})(input); + // output text in plain text so we can compare it + const actual = await cli(['--color=false'], {cwd})(input); expect(actual.stdout).toContain(input); expect(actual.code).toBe(1); @@ -338,7 +339,8 @@ test('should print full commit message when input from stdin fails', async () => test('should not print commit message fully or partially when input succeeds', async () => { const cwd = await gitBootstrap('fixtures/default'); const message = 'type: bar\n\nFoo bar bizz buzz.\n\nCloses #123.'; - const actual = await cli([], {cwd})(message); + // output text in plain text so we can compare it + const actual = await cli(['--color=false'], {cwd})(message); expect(actual.stdout).not.toContain(message); expect(actual.stdout).not.toContain(message.split('\n')[0]);