Skip to content

Prove can't-fail test verdicts with a mutation - #2404

Merged
kmcginnes merged 1 commit into
mainfrom
prove-test-verdicts-with-mutations
Oct 9, 2026
Merged

kmcginnes merged 1 commit into
mainfrom
prove-test-verdicts-with-mutations

Conversation

@kmcginnes

Copy link
Copy Markdown
Collaborator

Summary

A review recommended deleting cross-tab isolation tests as "can't fail" after reasoning about the current code, when the tests only needed to mount the open tab's atom. These two rules make that verdict something a reviewer proves rather than argues.

 REVIEW.md › Tests that can't fail
-  Ask whether the test would fail if the change were reverted.
+  Name a plausible regression of the behavior the test's name promises,
+  and prove the verdict with a mutation. A test that stays green is the
+  finding; tighten it until the mutation turns it red. Delete only when
+  no regression of that behavior could reach the test.

 docs/agents/testing.md › Special cases
+  Jotai mount effects: store.get doesn't mount an atom, so onMount never
+  runs. Mount it with store.sub(atom, () => {}) when the behavior depends on it.

The Jotai note is the gotcha behind the near-miss: the test fidelity PR (#2389) showed that an onMount cross-tab sync left the old tests green and turned the subscribed ones red.

Merge Danger

Door: two-way

Impact: none

Review and testing guidance only.

Related

@kmcginnes kmcginnes left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

@kmcginnes
kmcginnes merged commit b864b5d into main Oct 9, 2026
1 check passed
@kmcginnes
kmcginnes deleted the prove-test-verdicts-with-mutations branch October 9, 2026 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant