refactor(test): DRY shared setup + selective arrange/act/assert #23
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "refactor/tests-cleanup"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Pure test refactor across all packages — no production code changed, no test behavior changed. Same scenarios, same assertions, identical pass counts before/after in every package.
What changed
t.Helper()):views:quietTerm(collapses ~154TERM/NO_COLORsetenv pairs) +writeGraph(the tempdir →pages/→ write.md→BuildIndexdance); existingbootApp/bootAppAtnow route env setup throughquietTerminstead of duplicating it.graph:fixturePath/buildFixtureIndex/buildTempIndex/mapReader/linkifyOK.sync:cloneSibling; reused existingwriteFile.search:fixtureGraph/writePage; reused therg-missing skip guard.render:mustRender/mustRenderEmphasis/plainText/rowOf.// arrange,// act,// assertsections to imperative single-scenario tests; left table-driven (cases := []struct{…}loop) tests as clean loops.cmd/weftwas already a clean table test and is untouched.Verification
go build ./...,go vet ./...— cleangofmt -l— clean on all test filesgo test -count=1 ./...— all greenTwo new shared
helpers_test.gofiles (internal/views,internal/graph). Follows theinternal/edit/editor_test.gostyle established in #22.