-
-
Notifications
You must be signed in to change notification settings - Fork 96
Improve Test Coverage #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This PR increases the code coverage to exceed the 80% threshold for all metrics. Key improvements: Fixed failing tests in the auth module by adding proper mocks for getLocationsApi, enhanced client.ts test coverage with comprehensive tests for all API methods, improved error formatting test coverage with edge case handling, fixed TypeScript errors, and enhanced server test improvements. Current coverage metrics: Statement coverage: 94.65%, Branch coverage: 83.33%, Function coverage: 97.56%, Line coverage: 94.65%.
Update import statement for Azure DevOps configuration type from `AzureDevOpsConfigs` to `AzureDevOpsConfig` to align with TypeScript naming best practices
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Overview
This PR increases test coverage across the Azure DevOps API integration by addressing failing tests and improving error handling in the authentication and client modules. Key changes include:
- Adding comprehensive tests and proper mocks for Azure DevOps API methods.
- Enhancing error formatting and validation in the authentication and API client modules.
- Updating server transport connection and documentation.
Reviewed Changes
| File | Description |
|---|---|
| src/api/client.ts | Implements API client methods with improved error wrapping. |
| src/api/auth.ts | Adds PAT-based authentication with validation and error handling. |
| tests/unit/api/auth.test.ts | Introduces tests for authentication error conditions and PAT format. |
| tests/unit/api/client.test.ts | Enhances test coverage for all API client getters and error handling. |
| tests/unit/api/errors.test.ts | Verifies behavior and formatting for all custom error classes. |
| tests/unit/server.test.ts | Provides extensive tests for server initialization and tool handlers. |
| src/api/README.md | Documents module usage, authentication, and API access examples. |
| src/server.ts | Updates transport connection logic and related error logging. |
| project-management/task-management/*.md | Updates task management documentation and status tracking. |
Copilot reviewed 19 out of 19 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (1)
tests/unit/server.test.ts:89
- Consider standardizing the error messages for organization URL validation. One test expects 'Invalid organization URL' while another expects 'Invalid organization URL domain'.
expect(() => new AzureDevOpsServer(invalidConfig)).toThrow('Invalid organization URL');
- Add `inspector` npm script to run MCP inspector with built project - Update `doing.md` with detailed task for fixing MCP server implementation - Provide comprehensive research notes on current server implementation issues
* feat(repositories): support diff commits and list branch commits * feat: support pull request tags * fix: validate deletion patches before removing files * feat: improve tool description for agents, documentation and delete file unit test
🤖 I have created a release *beep* *boop* --- ## [0.1.43](mcp-server-azure-devops-v0.1.42...mcp-server-azure-devops-v0.1.43) (2025-11-19) ### Features * - adding a pullRequestId filter in - adding source and target … ([#12](#12)) ([f33e557](f33e557)) * add publishing configuration ([c058e59](c058e59)) * add pull request checks tool ([#11](#11)) ([6c1dfd5](6c1dfd5)) * add repository tree and branch/commit tools ([a95e6f2](a95e6f2)) * added prepack script to ensure the binary is built and marked executable before publishing ([757fea8](757fea8)) * improve commit workflow and add branch commit listing tool ([#7](#7)) ([867bbc8](867bbc8)) * include file diffs in pull request changes ([#3](#3)) ([0335c68](0335c68)) * provide simpler search/replace functionality for the create_commit tool ([1d1ec3f](1d1ec3f)) * version bump to 0.1.45 ([67e7a3d](67e7a3d)) ### Bug Fixes * **ci:** update workflow to use pull_request_target and latest checkout action ([fb109a7](fb109a7)) * clarify instruction on how to use the create_commit tool ([bd82c00](bd82c00)) * clarify instruction on how to use the create_commit tool ([167893e](167893e)) * **deps:** address high vulnerability without breaking changes ([#4](#4)) ([cb20e2d](cb20e2d)) * **pull-requests:** include diff content in pull request changes ([#6](#6)) ([d48aacc](d48aacc)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Micah Rairdon <[email protected]>
This PR increases the code coverage to exceed the 80% threshold for all metrics. Key improvements: Fixed failing tests in the auth module by adding proper mocks for getLocationsApi, enhanced client.ts test coverage with comprehensive tests for all API methods, improved error formatting test coverage with edge case handling, fixed TypeScript errors, and enhanced server test improvements. Current coverage metrics: Statement coverage: 94.65%, Branch coverage: 83.33%, Function coverage: 97.56%, Line coverage: 94.65%.