Skip to content

feat: Add golden files to test cli help output #4897

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Nov 4, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Unset all envs
  • Loading branch information
mafredri committed Nov 4, 2022
commit 0928b8b8a59da7d286bca3b2988271bc469f65f1
6 changes: 2 additions & 4 deletions cli/root_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,10 @@ func TestCommandHelp(t *testing.T) {
for _, tt := range tests {
tt := tt
t.Run(tt.name, func(t *testing.T) {
// Unset all CODER_ environment variables for a clean slate.
// Unset all environment variables for a clean slate.
for _, kv := range os.Environ() {
name := strings.Split(kv, "=")[0]
if _, ok := tt.env[name]; !ok && strings.HasPrefix(name, "CODER_") {
t.Setenv(name, "")
}
t.Setenv(name, "")
}
// Override environment variables for a reproducible test.
for k, v := range tt.env {
Expand Down