[docs] DaySentence: Analysis, review, lessons, and G1.5 closed for the code
This commit is contained in:
@@ -131,3 +131,18 @@ equality is blind to exactly the field that is absent by accident.
|
||||
|
||||
**How to apply it.** For "holds this and nothing else", use `toStrictEqual`, and give the
|
||||
test something real to leak (here, a kept identity).
|
||||
|
||||
## A helper that searches for a moment can land on a boundary
|
||||
|
||||
**What happened.** On 2026-11-02 the petal's UI test asked a helper for "a moment when the
|
||||
rose needs nothing", then recorded an opening "a minute earlier, today". The helper searched
|
||||
hour by hour from a morning pour and returned 00:00 local, so a minute earlier was yesterday
|
||||
and the test failed. The component was right; the first suspicion fell on it.
|
||||
|
||||
**Why it bit.** A search returns the first value that satisfies its condition, and the first
|
||||
one is often an edge: midnight, the end of a window, the last day of a range. The test then
|
||||
asserts something the edge makes false.
|
||||
|
||||
**How to apply it.** Bound every search to the region the test means (here: daytime on the
|
||||
pour's own local day), and when a test built on a search fails, print what the search
|
||||
returned before debugging the code under test.
|
||||
|
||||
Reference in New Issue
Block a user