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

fix bun test example #236

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

fix bun test example #236

wants to merge 1 commit into from

Conversation

swdyh
Copy link

@swdyh swdyh commented Feb 10, 2024

In the test when using bun, make the request method the same as the non-bun case.

@@ -59,6 +59,7 @@ export default app // [!code --]
export default { // [!code ++]
port: 3000, // [!code ++]
fetch: app.fetch, // [!code ++]
request: app.request, // [!code ++]
Copy link
Member

Choose a reason for hiding this comment

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

This is not necessary.

Copy link
Author

Choose a reason for hiding this comment

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

When you say "this is not needed", does that mean you can use app.request without it?
Please tell me why it is not necessary.

Without this line, in my environment(bun 1.0.26, hono 4.0.1, 3.12.12) I get an error like this.

スクリーンショット 2024-02-12 0 42 48

Copy link
Member

Choose a reason for hiding this comment

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

I assume the following case where the port number is not changed.

const app = new Hono()

// ...

export default app

The exported application contains the request property.

Copy link
Author

Choose a reason for hiding this comment

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

Yes, I understand that if "app" is exported, it has a request property. This proposal is to use "app.request" when "app" is not exported with port change. If you don't need that, then so be it. Thank you.

Copy link
Member

Choose a reason for hiding this comment

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

Thank you for understanding. I want to keep it simple here, so can you please remove that line?

@yusukebe
Copy link
Member

@swdyh

Thanks. I've commented. Check it.

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

Successfully merging this pull request may close these issues.

2 participants