-
Notifications
You must be signed in to change notification settings - Fork 516
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(netlify-edge): add tests #2897
base: v2
Are you sure you want to change the base?
Conversation
// netlify-edge intentionally ignores prerendered routes | ||
it.skipIf(ctx.preset === "netlify-edge")( | ||
"prerendered API routes work", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pi0 I believe you didn't like this in the original PR. Let me know if you have any other ideas π€·πΌ.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prerendered routes are basically static assets. Maybe worth to implement small stub in request handler that emulates netlify edge behavior? (otherwise current hotfix if allows to move it forward faster is good enough IMO -- we can do later)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for work on this β€οΈ
}; | ||
return async ({ url: rawRelativeUrl, headers, method, body }) => { | ||
// creating new URL object to parse query easier | ||
const url = new URL(`https://example.com${rawRelativeUrl}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use newURL(rawRelativeUrl, headers['host'])? (right now we don't have host tests I guess but it might fail later and need the right fix.
// netlify-edge intentionally ignores prerendered routes | ||
it.skipIf(ctx.preset === "netlify-edge")( | ||
"prerendered API routes work", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prerendered routes are basically static assets. Maybe worth to implement small stub in request handler that emulates netlify edge behavior? (otherwise current hotfix if allows to move it forward faster is good enough IMO -- we can do later)
π Linked issue
N/A
β Type of change
π Description
The
netlify-edge
preset has no tests. This adds tests.Previously added in #2822 but cut out before merging.
π Checklist