package gitea_test import ( "testing" "git.d-ma.be/mathias/cad-atlas/internal/gitea" ) // The unset path is the one that runs live right now: GITEA_TOKEN is still not // provisioned in prod (#4), so MyRepos must fail cleanly rather than issue an // unauthenticated request, letting liveOverlay skip and keep the authored // placeholder nodes. func TestMyRepos_ErrorsWhenTokenUnset(t *testing.T) { t.Setenv("GITEA_TOKEN", "") body, err := gitea.MyRepos() if err == nil { t.Fatal("want an error when GITEA_TOKEN is unset, got nil") } if body != nil { t.Fatalf("want nil body on error, got %d bytes", len(body)) } }