NTARH@4 and App Router Compatibility #953
Xunnamius
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Ok! Around 8 months after App Router support left beta with [email protected], and around 2 months after things stabilized a bit with [email protected] and next@14, NTARH has landed its own App Router support with the version 4 release! 🎉🍾🎉
See the release notes for technical details, including several breaking changes.
I'll keep this issue pinned until the next minor release. Happy testing!
Migration Guide
To ensure as smooth an experience as possible, preserving backwards compatibility where relevant was a priority for this release. To migrate your Pages Router tests to NTARH@4:
Replace the
handler
property name withpagesHandler
when invokingtestApiHandler
in your test files. Check the introductory documentation for examples.Ensure NTARH is always the first import in your test files. Why?
Little has changed with NTARH's Pages Router support, so there should be no issues. For those with tests that are failing for strange Next.js-related reasons, consult the change log and take note of any breaking changes that may apply to you. If you're still having issues with your Pages Router handlers at that point, please open a new issue.
App Router Support Is Kinda Precarious
The App Router first surfaced in October 2022, and the past 14 months have seen some significant churn within the Next.js code base. I've done my best to perch NTARH's App Router functionality atop the most stable-looking internal interfaces, but there are no guarantees that the App Router will not undergo further extensive refactoring. Like with the Pages Router, we'll roll with the punches as our testing infrastructure detects them. If you're having problems testing your App Router handler, please drop a note here or open a new issue.
Beta Was this translation helpful? Give feedback.
All reactions