next-test-api-route-handler • Docs
next-test-api-route-handler / testApiHandler
testApiHandler<
NextResponseJsonType
>(__namedParameters
):Promise
<void
>
Uses Next's internal apiResolver
(for Pages Router) or an
AppRouteRouteModule
instance (for App Router) to execute api route handlers
in a Next-like testing environment.
• NextResponseJsonType = any
• __namedParameters: NtarhInitAppRouter
<NextResponseJsonType
> | NtarhInitPagesRouter
<NextResponseJsonType
>
Promise
<void
>