Skip to content

Commit

Permalink
CORE-19112: Turn off colour output in CLI under test (#215)
Browse files Browse the repository at this point in the history
This prevents terminal escape codes from being caputred by the test.
  • Loading branch information
josephzunigadaly authored Dec 27, 2023
1 parent 30c15fe commit e97bd4d
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ class ExamplePluginTest {

return String(byteArrayOutputStream.toByteArray()).replace("\r\n", "\n")
}

private val colorScheme = CommandLine.Help.ColorScheme.Builder().ansi(CommandLine.Help.Ansi.OFF).build()
}

@Test
Expand All @@ -46,9 +48,9 @@ class ExamplePluginTest {
val app = ExamplePlugin.ExamplePluginEntry()

val outText = tapSystemErr {
CommandLine(
app
).execute("")
CommandLine(app)
.setColorScheme(colorScheme)
.execute("")
}

assertTrue(
Expand Down

0 comments on commit e97bd4d

Please sign in to comment.