-
-
Notifications
You must be signed in to change notification settings - Fork 11.7k
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
✅ test: Add unit test for src/server/routers/lambda/aiProvider.ts #5686
base: main
Are you sure you want to change the base?
✅ test: Add unit test for src/server/routers/lambda/aiProvider.ts #5686
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
👍 @gru-agent[bot] Thank you for raising your pull request and contributing to our Community |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5686 +/- ##
==========================================
+ Coverage 92.10% 92.41% +0.31%
==========================================
Files 647 658 +11
Lines 57711 59834 +2123
Branches 4074 3130 -944
==========================================
+ Hits 53152 55296 +2144
+ Misses 4559 4538 -21
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
TestGru AssignmentSummary
Tip You can |
Trigger Info
Summary
This PR introduces comprehensive unit tests for the
aiProviderRouter
module, ensuring robust coverage for all key functionalities. The following test cases have been implemented:createAiProvider
: Verifies the creation of a new AI provider, including encryption of sensitive data.getAiProviderById
: Tests retrieval of an AI provider by its ID.getAiProviderList
: Ensures the correct fetching of a list of AI providers.getAiProviderRuntimeState
: Validates retrieval of runtime state for AI providers.removeAiProvider
: Confirms successful deletion of an AI provider.toggleProviderEnabled
: Tests toggling the enabled state of an AI provider.updateAiProvider
: Verifies updates to AI provider details.updateAiProviderConfig
: Ensures proper updating of AI provider configurations with encryption.updateAiProviderOrder
: Tests reordering of AI providers.Additionally, minor adjustments were made to the
aiProvider.ts
file to exportaiProviderProcedure
for potential reuse. Mocking strategies were employed to isolate dependencies, ensuring the tests focus solely on the router's logic.Tip
You can
@gru-agent
and leave your feedback. TestGru will make adjustments based on your inputTip
You can
@gru-agent rebase
to rebase the PR.Tip
You can
@gru-agent redo
to reset or rebase before redoing the PR.Tip
To modify the test code yourself, click here Edit Test Code