Skip to content

Commit

Permalink
test(printRestult): force color
Browse files Browse the repository at this point in the history
  • Loading branch information
10xLaCroixDrinker committed Mar 12, 2024
1 parent a219ced commit bc1c762
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/printResult.test.js
Expand Up @@ -179,6 +179,8 @@ test('should print with color when color is supported', (t) => {
}
}

const { FORCE_COLOR } = process.env
process.env.FORCE_COLOR = '1'
const outputStream = new Writable({
write () {}
})
Expand All @@ -187,6 +189,7 @@ test('should print with color when color is supported', (t) => {
// act
const output = printResult(result, { outputStream })
t.ok(ansiRegex().test(output))
process.env.FORCE_COLOR = FORCE_COLOR
})

test('should not print with any color when color is not supported', (t) => {
Expand Down

0 comments on commit bc1c762

Please sign in to comment.