Repository navigation
test(hamode): add unit tests for Detect - #40
Conversation
|
Thanks for this @alexsmolya — and welcome, this is your first contribution here. First, an apology for the delay: your CI never ran. GitHub holds workflow runs from first-time contributors until a maintainer approves them, and nobody did, so this PR has been sitting since yesterday showing no checks through no fault of yours. I've approved it and CI is running now. In the meantime I verified it locally rather than leaving you waiting on that:
The thing I want to call out as a genuinely good decision: the Covering the empty-string case alongside it pins down the Leaving the merge to @mar-schmidt as maintainer. |
|
Merged — thanks @alexsmolya. I verified this rather than just trusting the green check: |
Closes #34
This is a tests-only patch adding unit test coverage for
hamode.Detect()ininternal/hamode/hamode_test.go.Covered Cases
Table-driven tests covering the three environment states for
SUPERVISOR_TOKEN:unset:SUPERVISOR_TOKENis unset in the process environment ->Detect()returnsfalseset to non-empty:SUPERVISOR_TOKENis set to"mock-supervisor-token"viat.Setenv->Detect()returnstrueset to empty string:SUPERVISOR_TOKENis set to""viat.Setenv->Detect()returnsfalseValidation
go test ./internal/hamode/... -v(3/3 subtests pass)go test ./internal/autostart/... ./internal/claudeauth/... ./internal/discovery/... -v(pass)gofmt -d ./internal/hamode/hamode_test.go(clean)go vet ./internal/hamode/...(clean)git diff --check(clean)