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
fix(runtime): Merge dynamic next-step params into templates
Apply dynamic next-step params even when manifest templates already define\nparams so scaffold follow-up actions resolve placeholders correctly.\n\nAlign testing docs and pattern checks with the canonical policy:\nuse executor/filesystem DI for external boundaries and allow Vitest\nmocking for internal collaborators.
Co-Authored-By: Claude <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: docs/dev/ARCHITECTURE.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -418,7 +418,7 @@ Not all parts are required for every tool. For example, `swift_package_build` ha
418
418
419
419
### Testing Principles
420
420
421
-
XcodeBuildMCP uses a strict **Dependency Injection (DI)** pattern for testing, which completely bans the use of traditional mocking libraries like Vitest's `vi.mock` or `vi.fn`. This ensures that tests are robust, maintainable, and verify the actual integration between components.
421
+
XcodeBuildMCP uses a **Dependency Injection (DI)** pattern for testing external boundaries (command execution, filesystem, and other side effects). Vitest mocking libraries (`vi.mock`, `vi.fn`, etc.) are acceptable for internal collaborators when needed. This keeps tests robust while preserving deterministic behavior at external boundaries.
422
422
423
423
For detailed guidelines, see the [Testing Guide](TESTING.md).
Copy file name to clipboardExpand all lines: docs/dev/CONTRIBUTING.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -270,8 +270,8 @@ Before making changes, please familiarize yourself with:
270
270
All contributions must adhere to the testing standards outlined in the [**XcodeBuildMCP Plugin Testing Guidelines (TESTING.md)**](TESTING.md). This is the canonical source of truth for all testing practices.
271
271
272
272
**Key Principles (Summary):**
273
-
-**No Vitest Mocking**: All forms of `vi.mock`, `vi.fn`, `vi.spyOn`, etc., are strictly forbidden.
274
-
-**Dependency Injection**: All external dependencies (command execution, file system access) must be injected into tool logic functions using the `CommandExecutor` and `FileSystemExecutor` patterns.
273
+
-**Dependency Injection for External Boundaries**: All external dependencies (command execution, file system access) must be injected into tool logic functions using the `CommandExecutor` and `FileSystemExecutor` patterns.
274
+
-**Internal Mocking Is Allowed**: Vitest mocking (`vi.mock`, `vi.fn`, `vi.spyOn`, etc.) is acceptable for internal modules/collaborators.
275
275
-**Test Production Code**: Tests must import and execute the actual tool logic, not mock implementations.
276
276
-**Comprehensive Coverage**: Tests must cover input validation, command generation, and output processing.
1.**Dependency injection**: Always use createMockExecutor() and createMockFileSystemExecutor()
1281
-
2.**No vitest mocking**: All vi.mock, vi.fn, etc. patterns are banned
1268
+
2.**External boundaries via DI**: mock command execution/filesystem with injected executors
1282
1269
3.**Three dimensions**: Test input validation, command execution, and output processing
1283
1270
4.**Literal expectations**: Use exact strings in assertions to catch regressions
1284
1271
5.**Performance**: Ensure fast execution through proper mocking
1285
1272
6.**Coverage**: Aim for 95%+ with focus on error paths
1286
1273
7.**Consistency**: Follow standard patterns across all plugin tests
1287
1274
8.**Test safety**: Default executors prevent accidental real system calls
1288
1275
1289
-
This testing strategy ensures robust, maintainable tests that provide confidence in plugin functionality while remaining resilient to implementation changes and completely eliminating vitest mocking dependencies.
1276
+
This testing strategy ensures robust, maintainable tests that provide confidence in plugin functionality while remaining resilient to implementation changes and keeping external boundaries deterministic.
0 commit comments