Skip to content

feat(hono/testing): Allow passing hc options to testClient #4059

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

kbrgl
Copy link

@kbrgl kbrgl commented Apr 7, 2025

This PR makes it possible to pass hc options to testClient. This excludes the fetch option, which is always passed by the testClient; removing it obviates the need for testClient entirely.

I needed this because I wanted my testClient to always pass certain headers for authentication in dev mode.

@kbrgl kbrgl changed the title Allow passing hc options to testClient feat(hono/testing): Allow passing hc options to testClient Apr 7, 2025
Copy link

codecov bot commented Apr 8, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.28%. Comparing base (882e75a) to head (8462e03).
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4059      +/-   ##
==========================================
- Coverage   91.32%   91.28%   -0.04%     
==========================================
  Files         168      168              
  Lines       10684    10769      +85     
  Branches     3032     3144     +112     
==========================================
+ Hits         9757     9831      +74     
- Misses        926      937      +11     
  Partials        1        1              

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Member

@yusukebe yusukebe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@yusukebe
Copy link
Member

Hi @kbrgl

This is a good feature. I'll merge this later, but I am wondering if we should ship this as a patch release or a minor release. I'll decide later. Thanks!

@kbrgl
Copy link
Author

kbrgl commented Apr 15, 2025

@yusukebe Thank you for the review! This seems to be a minor release to me since it adds a small feature, but will defer to you on the best practices for your project. Thanks for making Hono! 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants