You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: extract runtimeConfig default; use async fs and test.concurrent in extensionManager tests
**aiService.ts:**
- Extract duplicated `metadata.runtimeConfig ?? { type: 'local', ... }` pattern into getWorkspaceRuntimeConfig() helper
**extensionManager.test.ts:**
- Use async fs (fs/promises) instead of sync fs operations
- Remove global test variables, use local vars in beforeEach/afterEach for isolation
- Add test.concurrent() to all tests for parallel execution
- Remove eslint-disable for sync fs methods
**AGENTS.md & docs/AGENTS.md:**
- Document preference for async fs in tests (never sync fs)
- Document preference for test.concurrent() to enable parallelization
- Note to avoid global vars in test files for proper isolation
_Generated with `cmux`_
Copy file name to clipboardExpand all lines: docs/AGENTS.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -271,7 +271,9 @@ await env.mockIpcRenderer.invoke(IPC_CHANNELS.WORKSPACE_CREATE, projectPath, bra
271
271
### Testing without Mocks (preferred)
272
272
273
273
- Prefer exercising real behavior over substituting test doubles. Do not stub `child_process`, `fs`, or discovery logic.
274
-
- Use temporary directories and real processes in unit tests where feasible. Clean up with `fs.rmSync(temp, { recursive: true, force: true })` in `afterEach`.
274
+
-**Use async fs operations (`fs/promises`) in tests, never sync fs**. This keeps tests fast and allows parallelization.
275
+
-**Use `test.concurrent()` for unit tests** to enable parallel execution. Avoid global variables in test files—use local variables in each test or `beforeEach` to ensure test isolation.
276
+
- Use temporary directories and real processes in unit tests where feasible. Clean up with `await fs.rm(temp, { recursive: true, force: true })` in async `afterEach`.
275
277
- For extension system tests:
276
278
- Spawn the real global extension host via `ExtensionManager.initializeGlobal()`.
277
279
- Create real on-disk extensions in a temp `~/.cmux/ext` or project `.cmux/ext` folder.
0 commit comments