tests: fix test to show that NO_COLOR=1 results in no color

This reproduces the problem in reported in #5041.
This commit is contained in:
Martin von Zweigbergk 2024-12-06 16:04:40 -08:00 committed by Martin von Zweigbergk
parent 8c6024c71f
commit 23f9cc7a4f

View file

@ -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###"
@ 230dd059e1b059aefc0da06a2e5a7dbf22362f22
 0000000000000000000000000000000000000000
@ 230dd059e1b059aefc0da06a2e5a7dbf22362f22
 0000000000000000000000000000000000000000
"###);
// Test that per-repo config overrides the user config.