Skip to content
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/utils/errorResponse.ts #6300

Merged
merged 1 commit into from
Feb 19, 2025

Conversation

gru-agent[bot]
Copy link
Contributor

@gru-agent gru-agent bot commented Feb 18, 2025

Trigger Info

Trigger Type Triggered By Source Pull Request Assignment
Auto Rebase arvinxx 6299 Detail

Summary

This PR enhances the createErrorResponse utility function by adding test cases for additional error types to ensure proper status code mapping. The following changes were made:

  • Added test cases for the following AgentRuntimeErrorType error types:

    • InsufficientQuota (returns 429)

    • QuotaLimitReached (returns 429)

    • ExceededContextWindow (returns 400)

    • ProviderBizError (returns 471)

    • OllamaBizError (returns 472)

  • Added test cases for the following ChatErrorType error types:

    • SystemTimeNotMatchError (returns 400)

    • OllamaServiceUnavailable (returns 472)

These additions improve test coverage and ensure the function handles a broader range of error scenarios correctly.

Tip

You can @gru-agent and leave your feedback. TestGru will make adjustments based on your input

Tip

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

@gru-agent gru-agent bot requested a review from arvinxx February 18, 2025 14:56
@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Feb 18, 2025
@gru-agent gru-agent bot mentioned this pull request Feb 18, 2025
8 tasks
Copy link

vercel bot commented Feb 18, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
lobe-chat-desktop ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 18, 2025 3:38pm
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
lobe-chat-database ⬜️ Ignored (Inspect) Feb 18, 2025 3:38pm
lobe-chat-preview ⬜️ Ignored (Inspect) Visit Preview Feb 18, 2025 3:38pm

@lobehubbot
Copy link
Member

👍 @gru-agent[bot]

Thank you for raising your pull request and contributing to our Community
Please make sure you have followed our contributing guidelines. We will review it as soon as possible.
If you encounter any problems, please feel free to connect with us.
非常感谢您提出拉取请求并为我们的社区做出贡献,请确保您已经遵循了我们的贡献指南,我们会尽快审查它。
如果您遇到任何问题,请随时与我们联系。

Copy link

codecov bot commented Feb 18, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.85%. Comparing base (352cb90) to head (dc6ccbb).
Report is 19 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##             main    #6300     +/-   ##
=========================================
  Coverage   91.84%   91.85%             
=========================================
  Files         684      684             
  Lines       62237    62237             
  Branches     2906     4334   +1428     
=========================================
+ Hits        57162    57166      +4     
+ Misses       5075     5071      -4     
Flag Coverage Δ
app 91.85% <ø> (+<0.01%) ⬆️
server 97.90% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@arvinxx arvinxx merged commit 3a51aea into main Feb 19, 2025
19 checks passed
@arvinxx arvinxx deleted the gru/src-utils-errorResponse-ts-1739890570106 branch February 19, 2025 16:54
@lobehubbot
Copy link
Member

❤️ Great PR @gru-agent[bot] ❤️

The growth of project is inseparable from user feedback and contribution, thanks for your contribution! If you are interesting with the lobehub developer community, please join our discord and then dm @arvinxx or @canisminor1990. They will invite you to our private developer channel. We are talking about the lobe-chat development or sharing ai newsletter around the world.
项目的成长离不开用户反馈和贡献,感谢您的贡献! 如果您对 LobeHub 开发者社区感兴趣,请加入我们的 discord,然后私信 @arvinxx@canisminor1990。他们会邀请您加入我们的私密开发者频道。我们将会讨论关于 Lobe Chat 的开发,分享和讨论全球范围内的 AI 消息。

@lobehubbot
Copy link
Member

🎉 This PR is included in version 1.61.6 🎉

The release is available on:

Your semantic-release bot 📦🚀

likaiqiang pushed a commit to likaiqiang/lobe-chat that referenced this pull request Feb 26, 2025
…onse.test.ts (lobehub#6300)

Co-authored-by: gru-agent[bot] <185149714+gru-agent[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants