Skip to content

Commit 4300a11

Browse files
committed
release: [email protected] [skip ci]
## 🪄 Fixes - **src:** address minor incompatibility with next\@15.5 ([290654c][2]) ## ⚙️ Build System - **deps:** bump @whatwg-node/server from 0.10.10 to 0.10.12 ([fc0de21][3]) - **deps:** bump core-js from 3.44.0 to 3.45.0 ([018776a][4]) - **deps:** bump core-js from 3.45.0 to 3.45.1 ([f017121][5]) [1]: https://github.com/Xunnamius/next-test-api-route-handler/compare/[email protected]@5.0.1 [2]: 290654c [3]: fc0de21 [4]: 018776a [5]: f017121
1 parent e9d6c65 commit 4300a11

File tree

10 files changed

+618
-599
lines changed

10 files changed

+618
-599
lines changed

CHANGELOG.md

Lines changed: 588 additions & 569 deletions
Large diffs are not rendered by default.

docs/src/functions/testApiHandler.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
> **testApiHandler**\<`NextResponseJsonType`\>(`__namedParameters`): `Promise`\<`void`\>
1010
11-
Defined in: [src/index.ts:299](https://github.com/Xunnamius/next-test-api-route-handler/blob/2864e3a2c10a43eec470c473dcbdc6e9599cfee3/src/index.ts#L299)
11+
Defined in: [src/index.ts:298](https://github.com/Xunnamius/next-test-api-route-handler/blob/e9d6c65a2563c98f0367b0ff43cd7ea952acf10a/src/index.ts#L298)
1212

1313
Uses Next's internal `apiResolver` (for Pages Router) or an
1414
`AppRouteRouteModule` instance (for App Router) to execute api route handlers

docs/src/interfaces/NtarhInit.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
# Interface: NtarhInit\<NextResponseJsonType\>
88

9-
Defined in: [src/index.ts:133](https://github.com/Xunnamius/next-test-api-route-handler/blob/2864e3a2c10a43eec470c473dcbdc6e9599cfee3/src/index.ts#L133)
9+
Defined in: [src/index.ts:132](https://github.com/Xunnamius/next-test-api-route-handler/blob/e9d6c65a2563c98f0367b0ff43cd7ea952acf10a/src/index.ts#L132)
1010

1111
## Extended by
1212

@@ -25,7 +25,7 @@ Defined in: [src/index.ts:133](https://github.com/Xunnamius/next-test-api-route-
2525

2626
> `optional` **rejectOnHandlerError**: `boolean`
2727
28-
Defined in: [src/index.ts:146](https://github.com/Xunnamius/next-test-api-route-handler/blob/2864e3a2c10a43eec470c473dcbdc6e9599cfee3/src/index.ts#L146)
28+
Defined in: [src/index.ts:145](https://github.com/Xunnamius/next-test-api-route-handler/blob/e9d6c65a2563c98f0367b0ff43cd7ea952acf10a/src/index.ts#L145)
2929

3030
If `false`, errors thrown from within a handler are kicked up to Next.js's
3131
resolver to deal with, which is what would happen in production. If `true`,
@@ -48,7 +48,7 @@ false
4848

4949
> **test**: (`parameters`) => `Promisable`\<`void`\>
5050
51-
Defined in: [src/index.ts:152](https://github.com/Xunnamius/next-test-api-route-handler/blob/2864e3a2c10a43eec470c473dcbdc6e9599cfee3/src/index.ts#L152)
51+
Defined in: [src/index.ts:151](https://github.com/Xunnamius/next-test-api-route-handler/blob/e9d6c65a2563c98f0367b0ff43cd7ea952acf10a/src/index.ts#L151)
5252

5353
`test` is a function that runs your test assertions. This function receives
5454
one destructured parameter: `fetch`, which is equivalent to

docs/src/interfaces/NtarhInitAppRouter.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
# Interface: NtarhInitAppRouter\<NextResponseJsonType\>
88

9-
Defined in: [src/index.ts:163](https://github.com/Xunnamius/next-test-api-route-handler/blob/2864e3a2c10a43eec470c473dcbdc6e9599cfee3/src/index.ts#L163)
9+
Defined in: [src/index.ts:162](https://github.com/Xunnamius/next-test-api-route-handler/blob/e9d6c65a2563c98f0367b0ff43cd7ea952acf10a/src/index.ts#L162)
1010

1111
The parameters expected by `testApiHandler` when using `appHandler`.
1212

@@ -26,7 +26,7 @@ The parameters expected by `testApiHandler` when using `appHandler`.
2626

2727
> **appHandler**: `Partial`\<`Omit`\<`AppRouteUserlandModule`, keyof `AppRouteHandlers`\> & `{ [key in keyof AppRouteHandlers]?: (req: NextRequest, segmentData?: any) => any }`\>
2828
29-
Defined in: [src/index.ts:172](https://github.com/Xunnamius/next-test-api-route-handler/blob/2864e3a2c10a43eec470c473dcbdc6e9599cfee3/src/index.ts#L172)
29+
Defined in: [src/index.ts:171](https://github.com/Xunnamius/next-test-api-route-handler/blob/e9d6c65a2563c98f0367b0ff43cd7ea952acf10a/src/index.ts#L171)
3030

3131
The actual App Router route handler under test. It should be an object
3232
containing one or more async functions named for valid HTTP methods and/or
@@ -40,15 +40,15 @@ for details.
4040

4141
> `optional` **pagesHandler**: `undefined`
4242
43-
Defined in: [src/index.ts:183](https://github.com/Xunnamius/next-test-api-route-handler/blob/2864e3a2c10a43eec470c473dcbdc6e9599cfee3/src/index.ts#L183)
43+
Defined in: [src/index.ts:182](https://github.com/Xunnamius/next-test-api-route-handler/blob/e9d6c65a2563c98f0367b0ff43cd7ea952acf10a/src/index.ts#L182)
4444

4545
***
4646

4747
### params?
4848

4949
> `optional` **params**: `Record`\<`string`, `string` \| `string`[]\>
5050
51-
Defined in: [src/index.ts:193](https://github.com/Xunnamius/next-test-api-route-handler/blob/2864e3a2c10a43eec470c473dcbdc6e9599cfee3/src/index.ts#L193)
51+
Defined in: [src/index.ts:192](https://github.com/Xunnamius/next-test-api-route-handler/blob/e9d6c65a2563c98f0367b0ff43cd7ea952acf10a/src/index.ts#L192)
5252

5353
`params` is passed directly to the handler and represents processed dynamic
5454
routes. This should not be confused with query string parsing, which is
@@ -64,7 +64,7 @@ once.
6464

6565
> `optional` **paramsPatcher**: (`params`) => `Promisable`\<`void` \| `Record`\<`string`, `string` \| `string`[]\>\>
6666
67-
Defined in: [src/index.ts:203](https://github.com/Xunnamius/next-test-api-route-handler/blob/2864e3a2c10a43eec470c473dcbdc6e9599cfee3/src/index.ts#L203)
67+
Defined in: [src/index.ts:202](https://github.com/Xunnamius/next-test-api-route-handler/blob/e9d6c65a2563c98f0367b0ff43cd7ea952acf10a/src/index.ts#L202)
6868

6969
A function that receives `params`, an object representing "processed"
7070
dynamic route parameters. Modifications to `params` are passed directly to
@@ -90,7 +90,7 @@ is handled by `Request` automatically.
9090

9191
> `optional` **rejectOnHandlerError**: `boolean`
9292
93-
Defined in: [src/index.ts:146](https://github.com/Xunnamius/next-test-api-route-handler/blob/2864e3a2c10a43eec470c473dcbdc6e9599cfee3/src/index.ts#L146)
93+
Defined in: [src/index.ts:145](https://github.com/Xunnamius/next-test-api-route-handler/blob/e9d6c65a2563c98f0367b0ff43cd7ea952acf10a/src/index.ts#L145)
9494

9595
If `false`, errors thrown from within a handler are kicked up to Next.js's
9696
resolver to deal with, which is what would happen in production. If `true`,
@@ -117,7 +117,7 @@ false
117117

118118
> `optional` **requestPatcher**: (`request`) => `Promisable`\<`void` \| `Request`\>
119119
120-
Defined in: [src/index.ts:215](https://github.com/Xunnamius/next-test-api-route-handler/blob/2864e3a2c10a43eec470c473dcbdc6e9599cfee3/src/index.ts#L215)
120+
Defined in: [src/index.ts:214](https://github.com/Xunnamius/next-test-api-route-handler/blob/e9d6c65a2563c98f0367b0ff43cd7ea952acf10a/src/index.ts#L214)
121121

122122
A function that receives a `NextRequest` object and returns a `Request`
123123
instance. Use this function to edit the request _before_ it's injected
@@ -143,7 +143,7 @@ NextRequest(returnedRequest, { ... })`.
143143

144144
> `optional` **responsePatcher**: (`res`) => `Promisable`\<`void` \| `Response`\>
145145
146-
Defined in: [src/index.ts:228](https://github.com/Xunnamius/next-test-api-route-handler/blob/2864e3a2c10a43eec470c473dcbdc6e9599cfee3/src/index.ts#L228)
146+
Defined in: [src/index.ts:227](https://github.com/Xunnamius/next-test-api-route-handler/blob/e9d6c65a2563c98f0367b0ff43cd7ea952acf10a/src/index.ts#L227)
147147

148148
A function that receives the `Response` object returned from `appHandler`
149149
and returns a `Response` instance. Use this function to edit the response
@@ -170,7 +170,7 @@ unhandled exception occurs _and_ `rejectOnHandlerError` is `true`.
170170

171171
> **test**: (`parameters`) => `Promisable`\<`void`\>
172172
173-
Defined in: [src/index.ts:152](https://github.com/Xunnamius/next-test-api-route-handler/blob/2864e3a2c10a43eec470c473dcbdc6e9599cfee3/src/index.ts#L152)
173+
Defined in: [src/index.ts:151](https://github.com/Xunnamius/next-test-api-route-handler/blob/e9d6c65a2563c98f0367b0ff43cd7ea952acf10a/src/index.ts#L151)
174174

175175
`test` is a function that runs your test assertions. This function receives
176176
one destructured parameter: `fetch`, which is equivalent to
@@ -198,7 +198,7 @@ one destructured parameter: `fetch`, which is equivalent to
198198

199199
> `optional` **url**: `string`
200200
201-
Defined in: [src/index.ts:233](https://github.com/Xunnamius/next-test-api-route-handler/blob/2864e3a2c10a43eec470c473dcbdc6e9599cfee3/src/index.ts#L233)
201+
Defined in: [src/index.ts:232](https://github.com/Xunnamius/next-test-api-route-handler/blob/e9d6c65a2563c98f0367b0ff43cd7ea952acf10a/src/index.ts#L232)
202202

203203
`url: 'your-url'` is shorthand for `requestPatcher: (request) => new
204204
NextRequest('your-url', request)`

docs/src/interfaces/NtarhInitPagesRouter.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
# Interface: NtarhInitPagesRouter\<NextResponseJsonType\>
88

9-
Defined in: [src/index.ts:239](https://github.com/Xunnamius/next-test-api-route-handler/blob/2864e3a2c10a43eec470c473dcbdc6e9599cfee3/src/index.ts#L239)
9+
Defined in: [src/index.ts:238](https://github.com/Xunnamius/next-test-api-route-handler/blob/e9d6c65a2563c98f0367b0ff43cd7ea952acf10a/src/index.ts#L238)
1010

1111
The parameters expected by `testApiHandler` when using `pagesHandler`.
1212

@@ -26,15 +26,15 @@ The parameters expected by `testApiHandler` when using `pagesHandler`.
2626

2727
> `optional` **appHandler**: `undefined`
2828
29-
Defined in: [src/index.ts:251](https://github.com/Xunnamius/next-test-api-route-handler/blob/2864e3a2c10a43eec470c473dcbdc6e9599cfee3/src/index.ts#L251)
29+
Defined in: [src/index.ts:250](https://github.com/Xunnamius/next-test-api-route-handler/blob/e9d6c65a2563c98f0367b0ff43cd7ea952acf10a/src/index.ts#L250)
3030

3131
***
3232

3333
### pagesHandler
3434

3535
> **pagesHandler**: `NextApiHandler` \| \{ `default`: `NextApiHandler`; \}
3636
37-
Defined in: [src/index.ts:250](https://github.com/Xunnamius/next-test-api-route-handler/blob/2864e3a2c10a43eec470c473dcbdc6e9599cfee3/src/index.ts#L250)
37+
Defined in: [src/index.ts:249](https://github.com/Xunnamius/next-test-api-route-handler/blob/e9d6c65a2563c98f0367b0ff43cd7ea952acf10a/src/index.ts#L249)
3838

3939
The actual Pages Router route handler under test. It should be an async
4040
function that accepts `NextApiRequest` and `NextApiResult` objects (in
@@ -50,7 +50,7 @@ will have a typed result.
5050

5151
> `optional` **params**: `Record`\<`string`, `unknown`\>
5252
53-
Defined in: [src/index.ts:261](https://github.com/Xunnamius/next-test-api-route-handler/blob/2864e3a2c10a43eec470c473dcbdc6e9599cfee3/src/index.ts#L261)
53+
Defined in: [src/index.ts:260](https://github.com/Xunnamius/next-test-api-route-handler/blob/e9d6c65a2563c98f0367b0ff43cd7ea952acf10a/src/index.ts#L260)
5454

5555
`params` is passed directly to the handler and represents processed dynamic
5656
routes. This should not be confused with query string parsing, which is
@@ -66,7 +66,7 @@ once.
6666

6767
> `optional` **paramsPatcher**: (`params`) => `Promisable`\<`void` \| `Record`\<`string`, `unknown`\>\>
6868
69-
Defined in: [src/index.ts:271](https://github.com/Xunnamius/next-test-api-route-handler/blob/2864e3a2c10a43eec470c473dcbdc6e9599cfee3/src/index.ts#L271)
69+
Defined in: [src/index.ts:270](https://github.com/Xunnamius/next-test-api-route-handler/blob/e9d6c65a2563c98f0367b0ff43cd7ea952acf10a/src/index.ts#L270)
7070

7171
A function that receives `params`, an object representing "processed"
7272
dynamic route parameters. Modifications to `params` are passed directly to
@@ -92,7 +92,7 @@ is handled automatically.
9292

9393
> `optional` **rejectOnHandlerError**: `boolean`
9494
95-
Defined in: [src/index.ts:146](https://github.com/Xunnamius/next-test-api-route-handler/blob/2864e3a2c10a43eec470c473dcbdc6e9599cfee3/src/index.ts#L146)
95+
Defined in: [src/index.ts:145](https://github.com/Xunnamius/next-test-api-route-handler/blob/e9d6c65a2563c98f0367b0ff43cd7ea952acf10a/src/index.ts#L145)
9696

9797
If `false`, errors thrown from within a handler are kicked up to Next.js's
9898
resolver to deal with, which is what would happen in production. If `true`,
@@ -119,7 +119,7 @@ false
119119

120120
> `optional` **requestPatcher**: (`request`) => `Promisable`\<`void`\>
121121
122-
Defined in: [src/index.ts:281](https://github.com/Xunnamius/next-test-api-route-handler/blob/2864e3a2c10a43eec470c473dcbdc6e9599cfee3/src/index.ts#L281)
122+
Defined in: [src/index.ts:280](https://github.com/Xunnamius/next-test-api-route-handler/blob/e9d6c65a2563c98f0367b0ff43cd7ea952acf10a/src/index.ts#L280)
123123

124124
A function that receives an `IncomingMessage` object. Use this function
125125
to edit the request _before_ it's injected into the handler.
@@ -143,7 +143,7 @@ lowercase.**
143143

144144
> `optional` **responsePatcher**: (`res`) => `Promisable`\<`void`\>
145145
146-
Defined in: [src/index.ts:286](https://github.com/Xunnamius/next-test-api-route-handler/blob/2864e3a2c10a43eec470c473dcbdc6e9599cfee3/src/index.ts#L286)
146+
Defined in: [src/index.ts:285](https://github.com/Xunnamius/next-test-api-route-handler/blob/e9d6c65a2563c98f0367b0ff43cd7ea952acf10a/src/index.ts#L285)
147147

148148
A function that receives a `ServerResponse` object. Use this function
149149
to edit the response _before_ it's injected into the handler.
@@ -164,7 +164,7 @@ to edit the response _before_ it's injected into the handler.
164164

165165
> **test**: (`parameters`) => `Promisable`\<`void`\>
166166
167-
Defined in: [src/index.ts:152](https://github.com/Xunnamius/next-test-api-route-handler/blob/2864e3a2c10a43eec470c473dcbdc6e9599cfee3/src/index.ts#L152)
167+
Defined in: [src/index.ts:151](https://github.com/Xunnamius/next-test-api-route-handler/blob/e9d6c65a2563c98f0367b0ff43cd7ea952acf10a/src/index.ts#L151)
168168

169169
`test` is a function that runs your test assertions. This function receives
170170
one destructured parameter: `fetch`, which is equivalent to
@@ -192,7 +192,7 @@ one destructured parameter: `fetch`, which is equivalent to
192192

193193
> `optional` **url**: `string`
194194
195-
Defined in: [src/index.ts:291](https://github.com/Xunnamius/next-test-api-route-handler/blob/2864e3a2c10a43eec470c473dcbdc6e9599cfee3/src/index.ts#L291)
195+
Defined in: [src/index.ts:290](https://github.com/Xunnamius/next-test-api-route-handler/blob/e9d6c65a2563c98f0367b0ff43cd7ea952acf10a/src/index.ts#L290)
196196

197197
`url: 'your-url'` is shorthand for `requestPatcher: (req) => { req.url =
198198
'your-url' }`

docs/test/util/functions/getNextjsReactPeerDependencies.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
> **getNextjsReactPeerDependencies**(`npmInstallNextJsString`): `Promise`\<`string`[]\>
1010
11-
Defined in: [test/util.ts:28](https://github.com/Xunnamius/next-test-api-route-handler/blob/2864e3a2c10a43eec470c473dcbdc6e9599cfee3/test/util.ts#L28)
11+
Defined in: [test/util.ts:28](https://github.com/Xunnamius/next-test-api-route-handler/blob/e9d6c65a2563c98f0367b0ff43cd7ea952acf10a/test/util.ts#L28)
1212

1313
Since some versions of Next.js are released with flawed
1414
`package.json::peerDependencies`, sometimes we need to ensure the correct

docs/test/util/variables/globalDebugger.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88

99
> `const` **globalDebugger**: `ExtendedDebugger`
1010
11-
Defined in: [test/util.ts:21](https://github.com/Xunnamius/next-test-api-route-handler/blob/2864e3a2c10a43eec470c473dcbdc6e9599cfee3/test/util.ts#L21)
11+
Defined in: [test/util.ts:21](https://github.com/Xunnamius/next-test-api-route-handler/blob/e9d6c65a2563c98f0367b0ff43cd7ea952acf10a/test/util.ts#L21)

docs/test/util/variables/globalDebuggerNamespace.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
> `const` **globalDebuggerNamespace**: `"ntarh"` = `'ntarh'`
1010
11-
Defined in: [test/util.ts:19](https://github.com/Xunnamius/next-test-api-route-handler/blob/2864e3a2c10a43eec470c473dcbdc6e9599cfee3/test/util.ts#L19)
11+
Defined in: [test/util.ts:19](https://github.com/Xunnamius/next-test-api-route-handler/blob/e9d6c65a2563c98f0367b0ff43cd7ea952acf10a/test/util.ts#L19)
1212

1313
The project-wide namespace that appears in debugger output. Only used in
1414
tests.

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "next-test-api-route-handler",
3-
"version": "5.0.0",
3+
"version": "5.0.1",
44
"description": "Confidently unit and integration test your Next.js API routes/handlers in an isolated Next.js-like environment",
55
"keywords": [
66
"api",

0 commit comments

Comments
 (0)