-
-
Notifications
You must be signed in to change notification settings - Fork 552
Add comprehensive test coverage for 4 untested v1 API endpoints and enhance 3 existing test files #1699
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
|
The latest updates on your projects. Learn more about Vercel for GitHub. 3 Skipped Deployments
|
Co-authored-by: thibaultleouay <[email protected]>
Co-authored-by: thibaultleouay <[email protected]>
|
@copilot also add missing test case with different payload in existing test |
- Add TCP monitor tests for run and trigger endpoints - Add multiple region tests for run and trigger endpoints - Add different status tests for status report updates - Add result validation tests for monitor results endpoint - Total: 8 new test cases across 4 test files Co-authored-by: thibaultleouay <[email protected]>
Added 8 new test cases with different payloads across all 4 test files: Monitor Run (
Monitor Trigger (
Status Report Update (
Monitor Results (
Commit: c604daf |
|
For example In this file apps/server/src/routes/v1/monitors/post_tcp.test.ts You should add more test case with different payload @copilot |
b4e2533 to
b3464c1
Compare
Type of change
Description
Adds comprehensive test coverage for 4 previously untested API endpoints in
apps/server/src/routes/v1and enhances 3 existing test files with extensive payload variations.Test Files Added (4 new files, 30 tests)
monitors/results/get.test.ts(7 tests) - GET/v1/monitor/{id}/result/{resultId}endpointmonitors/run/post.test.ts(7 tests) - POST/v1/monitor/{id}/runendpoint with no-wait parameter supportmonitors/trigger/post.test.ts(7 tests) - POST/v1/monitor/{id}/triggerendpointstatusReports/update/post.test.ts(9 tests) - POST/v1/status_report/{id}/updatedeprecated endpointTest Files Enhanced (3 existing files, 44 tests)
monitors/post_tcp.test.ts(14 tests, was 3) - POST/v1/monitor/tcpendpoint:monitors/post_http.test.ts(16 tests, was 3) - POST/v1/monitor/httpendpoint:statusReportUpdates/post.test.ts(14 tests, was 3) - POST/v1/status_report_updateendpoint:Coverage
Each test suite validates:
Total: 74 test cases, 1200+ LOC. Tests follow existing patterns from
check/http/post.test.tsincluding mock fetch setup for external HTTP calls and schema validation for responses.Different Payload Test Cases Added
A picture tells a thousand words (if any)
N/A - Test coverage only
Before this PR
4 endpoint implementations without test coverage; 3 existing test files (TCP monitor, HTTP monitor, status report updates) had only 3 basic test cases each
After this PR
Complete test coverage for all v1 route endpoints with comprehensive payload variation testing; enhanced test files now have 14-16 test cases each covering all configuration options, HTTP methods, assertion types, and edge cases
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.