Skip to content

Commit 1e060d0

Browse files
committed
Check for NO_COLOR environment variable
1 parent a170306 commit 1e060d0

File tree

1 file changed

+3
-1
lines changed
  • junit-start/src/main/java/org/junit/start

1 file changed

+3
-1
lines changed

junit-start/src/main/java/org/junit/start/JUnit.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ private static void run(DiscoverySelector selector) {
5858
var listener = new SummaryGeneratingListener();
5959
var charset = Charset.defaultCharset();
6060
var writer = new PrintWriter(System.out, true, charset);
61-
var printer = new TreePrintingListener(writer, ColorPalette.DEFAULT, Theme.valueOf(charset));
61+
var palette = System.getenv("NO_COLOR") != null ? ColorPalette.NONE : ColorPalette.DEFAULT;
62+
var theme = Theme.valueOf(charset);
63+
var printer = new TreePrintingListener(writer, palette, theme);
6264
var request = request().selectors(selector).forExecution() //
6365
.listeners(listener, printer) //
6466
.build();

0 commit comments

Comments
 (0)