Skip to content

What's the point of this library, comparing it to supertest with your own testClient? #1067

Answered by Xunnamius
larscyl asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @larscyl! I actually saw your comment on Reddit (or, at least, I think it was you), but for some reason I could not interact with that post.

A few things:

First, note how you're using the old Pages Router API resolver. The new App Router API resolver is much more involved than just calling a function, including, for instance: patching the global fetch function, supporting the magic helper functions via AsyncLocalStorage, and passing around a proper NextRequest object.

Second, the thing about relying on internal APIs like AppRouteRouteModule (app router) or apiResolver (pages router) is that Vercel makes no guarantees about these primitives. If you take a peek at NTARH's source, you'll…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@larscyl
Comment options

@Xunnamius
Comment options

@larscyl
Comment options

Answer selected by larscyl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants