-
-
Notifications
You must be signed in to change notification settings - Fork 601
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
helper/ssg/index.test.tsx
does not close well
#2090
Comments
thanks. |
However, there seem to be times when it fails and times when it succeeds. |
It also occurred here. |
@yusukebe @EdamAme-x As a suggestion, how about putting pool: 'forks' in vitest.config.ts and WATCH to see if this case is resolved? I have tried this locally and so far it has not reoccurred. |
It may be that the problem is not on the test side, but on the code side. I'm still investigating, but the following changes will stop the hang. diff --git a/src/helper/ssg/index.ts b/src/helper/ssg/index.ts
index 721eb9f..b4a0af6 100644
--- a/src/helper/ssg/index.ts
+++ b/src/helper/ssg/index.ts
@@ -140,7 +140,7 @@ export const fetchRoutesContent = async <
for (const param of forGetInfoURLRequest.ssgParams) {
const replacedUrlParam = replaceUrlParam(route.path, param)
- let response = await app.request(replacedUrlParam, forGetInfoURLRequest)
+ let response = await app.request(new URL(replacedUrlParam, baseURL))
if (afterResponseHook) {
const maybeResponse = afterResponseHook(response)
if (!maybeResponse) continue I suspect that performing Line 134 in b98e850
Line 143 in b98e850
|
Sending a request twice is not a good implementation, so I am trying to figure out a way to do |
You are right, we should merge #2098 first so that the test does not hang. |
Thanks for investigating and the PR. Since the test no longer hangs, we can close this Issue. |
What version of Hono are you using?
latest https://github.com/honojs/hono/tree/b98e85092474ebc11884fc76ddf27fb29365cea1
What runtime/platform is your app running on?
CI/main
What steps can reproduce the bug?
Run tests on CI.
What is the expected behavior?
Passed.
What do you see instead?
https://github.com/honojs/hono/actions/runs/7654663888/job/20880284814
Additional information
No response
The text was updated successfully, but these errors were encountered: