mirror of
https://github.com/ivuorinen/gh-action-readme.git
synced 2026-03-22 20:03:52 +00:00
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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user