test(igniteui-mcp): add MCP cli and runtime unit tests#1572
Open
georgianastasov wants to merge 3 commits intofeat/igniteui-mcpfrom
Open
test(igniteui-mcp): add MCP cli and runtime unit tests#1572georgianastasov wants to merge 3 commits intofeat/igniteui-mcpfrom
georgianastasov wants to merge 3 commits intofeat/igniteui-mcpfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds Jasmine unit coverage for the new Ignite UI MCP integration by testing both the CLI launcher (ig mcp) and the MCP runtime behavior, and slightly refactors runtime logic to make key branches testable.
Changes:
- Added unit tests for the
ig mcpCLI command (package resolution, entrypoint validation, argument forwarding, spawn/exit/error behavior). - Added unit tests covering MCP runtime helpers, tool handlers, remote/local docs providers, and setup-guide/query-sanitization behavior.
- Extracted
search_docsquery sanitization and project setup guide assembly into dedicated helper functions used by the MCP server entrypoint.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| spec/unit/mcp-runtime-spec.ts | New runtime-focused Jasmine tests for MCP helpers, handlers, and docs providers. |
| spec/unit/mcp-cli-spec.ts | New Jasmine tests verifying ig mcp preflight checks and spawn/runtime behavior. |
| packages/igniteui-mcp/igniteui-doc-mcp/src/tools/doc-tools.ts | New helper module for query sanitization and setup-guide assembly used by MCP tools. |
| packages/igniteui-mcp/igniteui-doc-mcp/src/index.ts | Refactor to call extracted helper functions for search_docs and get_project_setup_guide. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds focused unit tests for the new MCP integration for the CLI and the MCP runtime. The goal is to cover the most important behavior with small, practical tests that fit the repo’s existing Jasmine setup.
What was added
CLI tests for the
ig mcpcommand:--remoteand--debugRuntime tests for MCP logic:
search_docsquery sanitizationget_project_setup_guidebehavior, including the Blazor-specific flowImplementation
To make the runtime behavior easier to test cleanly, the
search_docssanitization logic andget_project_setup_guideassembly logic were extracted fromsrc/index.tsinto small helper functions. This does not change the intended behavior, but it makes the important MCP branches testable with stable unit tests.Why this is useful
These tests give us confidence in the two places where the new MCP is working:
This keeps the coverage lightweight and meaningful, without introducing new test infrastructure or broader refactoring.