Skip to content

Commit

Permalink
tests: fix test to show that NO_COLOR=1 results in no color
Browse files Browse the repository at this point in the history
This reproduces the problem in reported in jj-vcs#5041.
  • Loading branch information
martinvonz committed Dec 7, 2024
1 parent 8c6024c commit 23f9cc7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cli/tests/test_global_opts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -437,11 +437,12 @@ fn test_color_config() {
"###);

// Test that NO_COLOR does NOT override the request for color in the config file
test_env.add_env_var("NO_COLOR", "");
test_env.add_env_var("NO_COLOR", "1");
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", "commit_id"]);
// TODO: Should have color
insta::assert_snapshot!(stdout, @r###"
[1m[38;5;2m@[0m [38;5;4m230dd059e1b059aefc0da06a2e5a7dbf22362f22[39m
[1m[38;5;14m◆[0m [38;5;4m0000000000000000000000000000000000000000[39m
[1m[m@[0m [m230dd059e1b059aefc0da06a2e5a7dbf22362f22[m
[1m[m◆[0m [m0000000000000000000000000000000000000000[m
"###);

// Test that per-repo config overrides the user config.
Expand Down

0 comments on commit 23f9cc7

Please sign in to comment.