We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fab00e3 commit 548273dCopy full SHA for 548273d
1 file changed
packages/testing/src/mocks/request.mock.ts
@@ -24,13 +24,15 @@ import { vi } from 'vitest'
24
* const response = await POST(req)
25
* ```
26
*/
27
+type NextRequestInit = NonNullable<ConstructorParameters<typeof NextRequest>[1]>
28
+
29
export function createMockRequest(
30
method = 'GET',
31
body?: unknown,
32
headers: Record<string, string> = {},
33
url = 'http://localhost:3000/api/test'
34
): NextRequest {
- const init: RequestInit = {
35
+ const init: NextRequestInit = {
36
method,
37
headers: new Headers({
38
'Content-Type': 'application/json',
0 commit comments