Easily unit/integration test your API routes with NTARH! #60838
Unanswered
Xunnamius
asked this question in
Show and tell
Replies: 1 comment
-
I am also a test freak and recently started a project where a custom backend would be a lot more work. Thanks a lot |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi there! I find I'm constantly starting API-heavy projects with Next.js, and as a TDD adherent, I thrive on the instant feedback unit testing provides. Yet I've found it difficult to test my Next.js API routes without rerunning time-consuming end-to-end tests or running through tedious manual testing with something like Postman. This lead me to develop NTARH (next-test-api-route-handler) with the goal of improving the unit and integration testing DX for Next.js routes.
Here's an example of an app route tested with NTARH:
I've been using NTARH successfully for both personal projects and to test production deployments over the past few years, and we just landed App Router support with version 4. If you've got some API routes you're working on, give it a spin. Feedback welcome :)
Beta Was this translation helpful? Give feedback.
All reactions