Skip to content

Latest commit

 

History

History
29 lines (16 loc) · 891 Bytes

testApiHandler.md

File metadata and controls

29 lines (16 loc) · 891 Bytes

next-test-api-route-handlerDocs


next-test-api-route-handler / testApiHandler

Function: 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.

Type Parameters

NextResponseJsonType = any

Parameters

__namedParameters: NtarhInitAppRouter<NextResponseJsonType> | NtarhInitPagesRouter<NextResponseJsonType>

Returns

Promise<void>

Defined in

index.ts:292