Skip to content

Commit a8ab878

Browse files
committed
docs(agents): require accept and reject tests for guards
1 parent 2f46ed2 commit a8ab878

3 files changed

Lines changed: 6 additions & 1 deletion

File tree

‎.coderabbit.yaml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ reviews:
7979
Require regression coverage at the lowest valid harness with behavior-focused
8080
assertions, including relevant negative, error, false/unset, and boundary cases.
8181
Check cleanup and deterministic async behavior and prefer shared typed test helpers.
82+
For guards and validators, require tests for both the accept path and the reject path
83+
through every public entry point; a reject-only matrix cannot catch a guard that rejects
84+
good input.
8285
Visible webview changes require a durable Playwright component snapshot; behavior-only
8386
changes do not.
8487
Reject weak assertions on values that could take multiple forms: .toBeDefined() or

‎AGENTS.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ Prefer the narrowest test layer that proves the behavior. This follows standard
4444
- Use `apps/vscode-e2e` only when the behavior depends on the real VS Code extension host, VS Code workspace APIs, extension activation, webview/extension messaging, file watcher behavior, or a complete user workflow.
4545
- Keep e2e tests focused on high-value smoke coverage across boundaries. Avoid placing detailed protocol, parsing, storage, retry, or edge-case assertions in e2e when they can be covered reliably at a lower layer.
4646
- When fixing a regression, add the regression test at the lowest layer that would have failed for the bug. Add an e2e test only if lower-level tests cannot represent the failure mode.
47+
- For a guard or validator, test the accept path and the reject path through every public entry point. A test that only rejects bad input does not prove the guard still accepts good input.
48+
- Use `it.each` for repeated cases and share the setup in a helper. Do not copy a test body per input.
49+
- A `Stryker disable` comment states the reason in one sentence. ESLint `max-len` limits it to 300 characters.
4750

4851
## Task Lifecycle Changes
4952

‎src/utils/pathUtils.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ async function realPathOfExistingAncestor(filePath: string): Promise<string | nu
8585
// walking to its deepest existing ancestor.
8686
try {
8787
const stat = await fs.promises.lstat(current)
88-
// Stryker disable next-line ConditionalExpression: equivalent mutant, lstat succeeding after a realpath ENOENT means a dangling symlink, so the condition is always true; the dangling-symlink tests pin the reject
8988
if (stat.isSymbolicLink()) {
9089
return null
9190
}

0 commit comments

Comments
 (0)