next-test-api-route-handler / src / NtarhInit
Defined in: src/index.ts:144
NextResponseJsonType = unknown
optionalrejectOnHandlerError?:boolean
Defined in: src/index.ts:157
If false, errors thrown from within a handler are kicked up to Next.js's
resolver to deal with, which is what would happen in production. If true,
the testApiHandler function will reject immediately instead.
You should use rejectOnHandlerError whenever you want to manually handle
an error that bubbles up from your handler (which is especially true if
you're using expect within your handler) or when you notice a false
negative despite exceptions being thrown.
falsetest: (
parameters) =>Promisable<void>
Defined in: src/index.ts:163
test is a function that runs your test assertions. This function receives
one destructured parameter: fetch, which is equivalent to
globalThis.fetch but with the first parameter omitted.
(customInit?) => FetchReturnType<NextResponseJsonType>
Promisable<void>