Skip to content

Commit

Permalink
CORE-19112: Turn off colour output in CLI under test (#214)
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 Jan 2, 2024
1 parent 564499e commit 2e44901
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,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 @@ -44,9 +46,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 2e44901

Please sign in to comment.