fix(tests): isolate wizard tests from GITHUB_TOKEN env var (#201)

* fix(tests): isolate wizard tests from GITHUB_TOKEN env var

Clear GITHUB_TOKEN and GH_README_GITHUB_TOKEN in wizard tests so the
wizard doesn't skip token prompts, which caused input misalignment
and "configuration canceled by user" failures.

* refactor(tests): use appconstants for env var names in wizard tests
This commit is contained in:
2026-03-22 17:38:09 +02:00
committed by GitHub
parent 2dc802a5d3
commit ccc55c37ff

View File

@@ -655,6 +655,8 @@ func TestConfigureGitHubIntegration(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
t.Setenv(appconstants.EnvGitHubTokenStandard, "")
t.Setenv(appconstants.EnvGitHubToken, "")
wizard := testWizard(tt.inputs)
if tt.existingToken != "" {
wizard.config.GitHubToken = tt.existingToken
@@ -996,6 +998,8 @@ func TestRun(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
t.Setenv(appconstants.EnvGitHubTokenStandard, "")
t.Setenv(appconstants.EnvGitHubToken, "")
wizard := testWizard(tt.inputs)
config, err := wizard.Run()