-
Notifications
You must be signed in to change notification settings - Fork 23
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
add chat routes unit tests #81
add chat routes unit tests #81
Conversation
Signed-off-by: Lin Wang <[email protected]>
Signed-off-by: Lin Wang <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #81 +/- ##
==========================================
+ Coverage 83.72% 91.61% +7.89%
==========================================
Files 43 43
Lines 1026 1026
Branches 239 239
==========================================
+ Hits 859 940 +81
+ Misses 166 85 -81
Partials 1 1 ☔ View full report in Codecov by Sentry. |
server/routes/chat_routes.test.ts
Outdated
const triggerGetSession = (sessionId: string) => | ||
triggerHandler(router, { | ||
method: 'get', | ||
path: `${ASSISTANT_API.SESSION}/{sessionId}`, | ||
req: httpServerMock.createRawRequest({ params: { sessionId } }), | ||
}); | ||
const triggerGetSessions = (query: GetSessionsSchema) => | ||
triggerHandler(router, { | ||
method: 'get', | ||
path: ASSISTANT_API.SESSIONS, | ||
req: httpServerMock.createRawRequest({ query }), | ||
}); |
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.
Actually there are get_session.test.ts and get_sessions.test.ts files which have already done similar test. Maybe remove the standalone files to keep just one test case?
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.
Updated
Signed-off-by: Lin Wang <[email protected]>
Description
Add unit tests for chat routes, except sendMessage and regenerate.
The unit tests for regenerate has been provided in another PR (#78 ).
Issues Resolved
[List any issues this PR will resolve]
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.