Skip to content

Commit 95c136d

Browse files
committed
docs(AGENTS): state explicit preference against mocks; dedupe root section
- Add 'Testing without Mocks (preferred)' guidance in both AGENTS.md and docs/AGENTS.md - Deduplicate accidentally duplicated section in root AGENTS.md _Generated with cmux_
1 parent 574a6c9 commit 95c136d

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

docs/AGENTS.md

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -280,18 +280,6 @@ await env.mockIpcRenderer.invoke(IPC_CHANNELS.WORKSPACE_CREATE, projectPath, bra
280280
- Avoid spies and partial mocks. If a mock seems necessary, consider fixing the test harness or refactoring code to make the behavior testable without mocks.
281281
- Acceptable exceptions: isolating nondeterminism (e.g., time) or external network calls. Prefer dependency injection with in-memory fakes over broad module mocks.
282282

283-
### Testing without Mocks (preferred)
284-
285-
- Prefer exercising real behavior over substituting test doubles. Do not stub `child_process`, `fs`, or discovery logic.
286-
- Use temporary directories and real processes in unit tests where feasible. Clean up with `fs.rmSync(temp, { recursive: true, force: true })` in `afterEach`.
287-
- For extension system tests:
288-
- Spawn the real global extension host via `ExtensionManager.initializeGlobal()`.
289-
- Create real on-disk extensions in a temp `~/.cmux/ext` or project `.cmux/ext` folder.
290-
- Register/unregister real workspaces and verify through actual tool execution.
291-
- Integration tests must go through real IPC. Use the test harness's `mockIpcRenderer.invoke()` to traverse the production IPC path (this is a façade, not a Jest mock).
292-
- Avoid spies and partial mocks. If a mock seems necessary, consider fixing the test harness or refactoring code to make the behavior testable without mocks.
293-
- Acceptable exceptions: isolating nondeterminism (e.g., time) or external network calls. Prefer dependency injection with in-memory fakes over broad module mocks.
294-
295283
If IPC is hard to test, fix the test infrastructure or IPC layer, don't work around it by bypassing IPC.
296284

297285
## Command Palette (Cmd+Shift+P)

0 commit comments

Comments
 (0)