Skip to content

Conversation

@sommeeeer
Copy link
Contributor

@sommeeeer sommeeeer commented Mar 18, 2025

This introduces more general E2E for all the different route handlers available. Let me know if I should include anything more in this PR.

It will test:

  • All supported HTTP methods (GET, POST, PUT, PATCH, DELETE, HEAD, and OPTIONS)
  • That formData works in POST route handler
  • That revalidation (ISR) works in GET route handler
  • That you can cache a GET route with force-static
  • That you can set cookies in a route handler
  • That you should be able to redirect in a route handler
  • Dynamic segments in a route handler
  • Query parameters

Reference: https://nextjs.org/docs/app/building-your-application/routing/route-handlers

btw, i had to turn off this in biome.jsonc: https://biomejs.dev/linter/rules/use-literal-keys as it was not happy with using headers["allow"] or similar.

@changeset-bot
Copy link

changeset-bot bot commented Mar 18, 2025

⚠️ No Changeset found

Latest commit: 0a10078

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@sommeeeer sommeeeer requested a review from conico974 March 19, 2025 16:39
Copy link
Contributor

@conico974 conico974 left a comment

Choose a reason for hiding this comment

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

LGTM Thanks a lot for that

@conico974 conico974 merged commit ad92bfd into opennextjs:main Mar 19, 2025
1 check passed
@sommeeeer sommeeeer deleted the verbs branch March 19, 2025 18:29
formData.append("name", "OpenNext [] () %&#!%$#");
formData.append("email", "[email protected]");
const postRes = await request.post("/methods/post/formdata", {
form: formData,
Copy link
Contributor

Choose a reason for hiding this comment

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

Posting a FormData doesn't work for Cloudflare, posting an object is fine (as in the cookies test). Wondering why it works here?

Copy link
Contributor

Choose a reason for hiding this comment

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

nvm updating Playwright fixes this

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.

3 participants