Skip to content

Commit 548273d

Browse files
committed
type check
1 parent fab00e3 commit 548273d

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

packages/testing/src/mocks/request.mock.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,15 @@ import { vi } from 'vitest'
2424
* const response = await POST(req)
2525
* ```
2626
*/
27+
type NextRequestInit = NonNullable<ConstructorParameters<typeof NextRequest>[1]>
28+
2729
export function createMockRequest(
2830
method = 'GET',
2931
body?: unknown,
3032
headers: Record<string, string> = {},
3133
url = 'http://localhost:3000/api/test'
3234
): NextRequest {
33-
const init: RequestInit = {
35+
const init: NextRequestInit = {
3436
method,
3537
headers: new Headers({
3638
'Content-Type': 'application/json',

0 commit comments

Comments
 (0)