@solaqua/ghosts 0.4.22 → 0.4.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -10,7 +10,7 @@ Design outside-in from caller usage and domain invariants. Repeated workarounds
|
|
|
10
10
|
- Before writing, briefly inspect existing code with a similar role in the repository and follow its conventions where applicable.
|
|
11
11
|
- Order functions so each callee appears below its caller.
|
|
12
12
|
- Write function and method docstring and TSDoc summaries as concise statements of purpose in domain terms. Describe what the function accomplishes without narrating internal steps or enumerating permissions, side effects, and error handling. Add contract details separately only when callers need them to use the function correctly. Prefer one sentence; expand only when necessary.
|
|
13
|
-
- Write tests as behavioral specifications: each test docstring or doc comment must stand alone, describe the scenario and observable outcome, and avoid relying on surrounding context, implementation details, or comparative wording. Keep names concise and behavior-based (JS/TS `it(...)` / `test(...)` descriptions suffice), and
|
|
13
|
+
- Write tests as behavioral specifications: each test docstring or doc comment must stand alone, describe the scenario and observable outcome, and avoid relying on surrounding context, implementation details, or comparative wording. Keep names concise and behavior-based (JS/TS `it(...)` / `test(...)` descriptions suffice), and structure the body with Gherkin keywords (`Given`, `When`, `Then`, `And`) as appropriate.
|
|
14
14
|
- Never use `if` statements or conditional expressions in test code, including setup, helpers, and assertions. Define each case's inputs and expected outcomes before execution; use separate cases or parameterization instead of branching.
|
|
15
15
|
- When complex setup, concurrency, timing, or multi-step control flow makes a test hard to follow, add concise comments at key transitions to explain the scenario and synchronization; do not narrate obvious code.
|
|
16
16
|
- Avoid low-value, brittle, implementation-coupled, over-mocked tests, or conditional tests that bypass required assertions or choose expectations from actual results—including tests that merely restate literals, constants, or configuration wiring; prefer outside-in integration tests through public interfaces, and add tests only when they specify meaningful externally observable behavior or guard against a substantive regression.
|