Documentation
¶
Overview ¶
Package tests is the base the suites of this module build on.
What belongs here is what more than one suite needs. A helper one suite uses belongs beside that suite, in the category directory it lives in.
The suites:
tests/Unit/ one thing, with nothing running tests/Feature/ a whole behaviour, across the layers that produce it tests/E2E/ the sequence of requests a client actually makes
The categories are directories rather than file suffixes because the toolchain only runs a file whose name ends in _test.go, and a naming scheme that competes with that rule switches the suite off without failing.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ModuleRoot ¶
ModuleRoot answers the directory holding this module's go.mod, and fails the test if it cannot be found.
Several tests read the source tree itself -- for a class that is never compiled into a stylesheet, for a file a project must not have, for a doc comment naming a directory that is gone. Each of those walks a root, and each one is silent when the root is wrong: a walk over an empty directory finds no violation and reports success.
So the root is asked for rather than written down. A relative path is correct only from the depth it was written at, and a test that moves one level keeps passing while checking nothing.
Types ¶
This section is empty.