test: Add Tests for /api/credit/lines and /api/credit/lines/:id Endpoints (#29)#71
Open
Bug-Hunter-X wants to merge 4 commits intoCreditra:mainfrom
Open
test: Add Tests for /api/credit/lines and /api/credit/lines/:id Endpoints (#29)#71Bug-Hunter-X wants to merge 4 commits intoCreditra:mainfrom
/api/credit/lines and /api/credit/lines/:id Endpoints (#29)#71Bug-Hunter-X wants to merge 4 commits intoCreditra:mainfrom
Conversation
… into test/credit-lines-endpoints # Conflicts: # package-lock.json # package.json
Contributor
Author
|
@greatest0fallt1me rei=view and merge sir |
Contributor
|
@Bug-Hunter-X Can you resolve the conflicts? |
Contributor
Author
DONE boss |
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.
Overview
Adds focused integration tests for credit line list/detail endpoints, including empty-list behavior, success responses, and not-found responses.
Also adds minimal route error-path tests to ensure the credit route file meets the required route-level coverage threshold.
Closes #29
Changes
Credit Route Endpoint Tests
GET /api/credit/lines:200with empty list when store is empty.GET /api/credit/lines/:id:200with full credit line payload for known ID.404with consistent not-found format for unknown ID.Route Coverage Support
Documentation
Tooling / Test Dependencies
supertestand@types/supertestunder dev dependencies.How to Run Tests
Verification Results
/api/credit/lines/api/credit/lines/:id100%forsrc/routes/credit.ts)Verification Evidence
npm test -- src/__test__/creditLinesEndpoints.test.ts src/__test__/creditRouteErrorHandling.test.ts2test files,14tests.npx vitest run src/__test__/creditLinesEndpoints.test.ts src/__test__/creditRouteErrorHandling.test.ts --coverage --coverage.include=src/routes/credit.ts --coverage.reporter=textsrc/routes/credit.ts:100%statements,100%branches,100%functions,100%lines.