Skip to content

Commit 945857b

Browse files
committed
release: 4.0.9 [skip ci]
### [4.0.9](v4.0.8...v4.0.9) (2024-09-13) #### 🪄 Fixes * **src:** prevent ipv6-related failures due to assuming "localhost" resolvability ([99118a6](99118a6)) <sup>closes [#1068](https://github.com/Xunnamius/next-test-api-route-handler/issues/1068)</sup> #### ⚙️ Build system * **externals:** update is-next-compat to work with Octokit's new esm exports ([50d2976](50d2976)) * **husky:** update husky scripts ([88948b6](88948b6)) * **package:** downgrade @octokit/rest to 20 ([fa4b2af](fa4b2af)) * Remove spellchecker dependency ([b0701a2](b0701a2))
1 parent 09aebe6 commit 945857b

File tree

9 files changed

+606
-584
lines changed

9 files changed

+606
-584
lines changed

CHANGELOG.md

Lines changed: 543 additions & 523 deletions
Large diffs are not rendered by default.

docs/functions/testApiHandler.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Uses Next's internal `apiResolver` (for Pages Router) or an
1212
`AppRouteRouteModule` instance (for App Router) to execute api route handlers
1313
in a Next-like testing environment.
1414

15-
## Type parameters
15+
## Type Parameters
1616

1717
**NextResponseJsonType** = `any`
1818

@@ -24,6 +24,6 @@ in a Next-like testing environment.
2424

2525
`Promise`\<`void`\>
2626

27-
## Source
27+
## Defined in
2828

29-
[index.ts:273](https://github.com/Xunnamius/next-test-api-route-handler/blob/43eec5385cb48f619257324a2fe1b54d29748ff1/src/index.ts#L273)
29+
[index.ts:273](https://github.com/Xunnamius/next-test-api-route-handler/blob/89d2409a8fbc9ba840b27d51fe118ce111e6c10f/src/index.ts#L273)

docs/interfaces/NtarhInit.md

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

77
# Interface: NtarhInit\<NextResponseJsonType\>
88

9+
**`Internal`**
10+
911
## Extended by
1012

1113
- [`NtarhInitAppRouter`](NtarhInitAppRouter.md)
1214
- [`NtarhInitPagesRouter`](NtarhInitPagesRouter.md)
1315

14-
## Type parameters
16+
## Type Parameters
1517

1618
**NextResponseJsonType** = `unknown`
1719

@@ -36,9 +38,9 @@ negative despite exceptions being thrown.
3638
false
3739
```
3840

39-
#### Source
41+
#### Defined in
4042

41-
[index.ts:123](https://github.com/Xunnamius/next-test-api-route-handler/blob/43eec5385cb48f619257324a2fe1b54d29748ff1/src/index.ts#L123)
43+
[index.ts:123](https://github.com/Xunnamius/next-test-api-route-handler/blob/89d2409a8fbc9ba840b27d51fe118ce111e6c10f/src/index.ts#L123)
4244

4345
***
4446

@@ -60,6 +62,6 @@ one destructured parameter: `fetch`, which is equivalent to
6062

6163
[`Promisable`](../type-aliases/Promisable.md)\<`void`\>
6264

63-
#### Source
65+
#### Defined in
6466

65-
[index.ts:129](https://github.com/Xunnamius/next-test-api-route-handler/blob/43eec5385cb48f619257324a2fe1b54d29748ff1/src/index.ts#L129)
67+
[index.ts:129](https://github.com/Xunnamius/next-test-api-route-handler/blob/89d2409a8fbc9ba840b27d51fe118ce111e6c10f/src/index.ts#L129)

docs/interfaces/NtarhInitAppRouter.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ The parameters expected by `testApiHandler` when using `appHandler`.
1212

1313
- [`NtarhInit`](NtarhInit.md)\<`NextResponseJsonType`\>
1414

15-
## Type parameters
15+
## Type Parameters
1616

1717
**NextResponseJsonType** = `unknown`
1818

@@ -58,19 +58,19 @@ for details.
5858

5959
> **PUT**: `undefined` \| (`req`, `context`?) => `any`
6060
61-
#### Source
61+
#### Defined in
6262

63-
[index.ts:146](https://github.com/Xunnamius/next-test-api-route-handler/blob/43eec5385cb48f619257324a2fe1b54d29748ff1/src/index.ts#L146)
63+
[index.ts:146](https://github.com/Xunnamius/next-test-api-route-handler/blob/89d2409a8fbc9ba840b27d51fe118ce111e6c10f/src/index.ts#L146)
6464

6565
***
6666

6767
### pagesHandler?
6868

6969
> `optional` **pagesHandler**: `undefined`
7070
71-
#### Source
71+
#### Defined in
7272

73-
[index.ts:155](https://github.com/Xunnamius/next-test-api-route-handler/blob/43eec5385cb48f619257324a2fe1b54d29748ff1/src/index.ts#L155)
73+
[index.ts:155](https://github.com/Xunnamius/next-test-api-route-handler/blob/89d2409a8fbc9ba840b27d51fe118ce111e6c10f/src/index.ts#L155)
7474

7575
***
7676

@@ -86,9 +86,9 @@ handled by `Request` automatically.
8686
params.id = 'some-id' }`. This is useful for quickly setting many params at
8787
once.
8888

89-
#### Source
89+
#### Defined in
9090

91-
[index.ts:165](https://github.com/Xunnamius/next-test-api-route-handler/blob/43eec5385cb48f619257324a2fe1b54d29748ff1/src/index.ts#L165)
91+
[index.ts:165](https://github.com/Xunnamius/next-test-api-route-handler/blob/89d2409a8fbc9ba840b27d51fe118ce111e6c10f/src/index.ts#L165)
9292

9393
***
9494

@@ -112,9 +112,9 @@ is handled by `Request` automatically.
112112

113113
[`Promisable`](../type-aliases/Promisable.md)\<`void` \| `Record`\<`string`, `string` \| `string`[]\>\>
114114

115-
#### Source
115+
#### Defined in
116116

117-
[index.ts:175](https://github.com/Xunnamius/next-test-api-route-handler/blob/43eec5385cb48f619257324a2fe1b54d29748ff1/src/index.ts#L175)
117+
[index.ts:175](https://github.com/Xunnamius/next-test-api-route-handler/blob/89d2409a8fbc9ba840b27d51fe118ce111e6c10f/src/index.ts#L175)
118118

119119
***
120120

@@ -141,9 +141,9 @@ false
141141

142142
[`NtarhInit`](NtarhInit.md).[`rejectOnHandlerError`](NtarhInit.md#rejectonhandlererror)
143143

144-
#### Source
144+
#### Defined in
145145

146-
[index.ts:123](https://github.com/Xunnamius/next-test-api-route-handler/blob/43eec5385cb48f619257324a2fe1b54d29748ff1/src/index.ts#L123)
146+
[index.ts:123](https://github.com/Xunnamius/next-test-api-route-handler/blob/89d2409a8fbc9ba840b27d51fe118ce111e6c10f/src/index.ts#L123)
147147

148148
***
149149

@@ -167,9 +167,9 @@ NextRequest(returnedRequest, { ... })`.
167167

168168
[`Promisable`](../type-aliases/Promisable.md)\<`void` \| `Request`\>
169169

170-
#### Source
170+
#### Defined in
171171

172-
[index.ts:188](https://github.com/Xunnamius/next-test-api-route-handler/blob/43eec5385cb48f619257324a2fe1b54d29748ff1/src/index.ts#L188)
172+
[index.ts:188](https://github.com/Xunnamius/next-test-api-route-handler/blob/89d2409a8fbc9ba840b27d51fe118ce111e6c10f/src/index.ts#L188)
173173

174174
***
175175

@@ -194,9 +194,9 @@ unhandled exception occurs _and_ `rejectOnHandlerError` is `true`.
194194

195195
[`Promisable`](../type-aliases/Promisable.md)\<`void` \| `Response`\>
196196

197-
#### Source
197+
#### Defined in
198198

199-
[index.ts:201](https://github.com/Xunnamius/next-test-api-route-handler/blob/43eec5385cb48f619257324a2fe1b54d29748ff1/src/index.ts#L201)
199+
[index.ts:201](https://github.com/Xunnamius/next-test-api-route-handler/blob/89d2409a8fbc9ba840b27d51fe118ce111e6c10f/src/index.ts#L201)
200200

201201
***
202202

@@ -222,9 +222,9 @@ one destructured parameter: `fetch`, which is equivalent to
222222

223223
[`NtarhInit`](NtarhInit.md).[`test`](NtarhInit.md#test)
224224

225-
#### Source
225+
#### Defined in
226226

227-
[index.ts:129](https://github.com/Xunnamius/next-test-api-route-handler/blob/43eec5385cb48f619257324a2fe1b54d29748ff1/src/index.ts#L129)
227+
[index.ts:129](https://github.com/Xunnamius/next-test-api-route-handler/blob/89d2409a8fbc9ba840b27d51fe118ce111e6c10f/src/index.ts#L129)
228228

229229
***
230230

@@ -235,6 +235,6 @@ one destructured parameter: `fetch`, which is equivalent to
235235
`url: 'your-url'` is shorthand for `requestPatcher: (request) => new
236236
NextRequest('your-url', request)`
237237

238-
#### Source
238+
#### Defined in
239239

240-
[index.ts:206](https://github.com/Xunnamius/next-test-api-route-handler/blob/43eec5385cb48f619257324a2fe1b54d29748ff1/src/index.ts#L206)
240+
[index.ts:206](https://github.com/Xunnamius/next-test-api-route-handler/blob/89d2409a8fbc9ba840b27d51fe118ce111e6c10f/src/index.ts#L206)

docs/interfaces/NtarhInitPagesRouter.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ The parameters expected by `testApiHandler` when using `pagesHandler`.
1212

1313
- [`NtarhInit`](NtarhInit.md)\<`NextResponseJsonType`\>
1414

15-
## Type parameters
15+
## Type Parameters
1616

1717
**NextResponseJsonType** = `unknown`
1818

@@ -22,9 +22,9 @@ The parameters expected by `testApiHandler` when using `pagesHandler`.
2222

2323
> `optional` **appHandler**: `undefined`
2424
25-
#### Source
25+
#### Defined in
2626

27-
[index.ts:224](https://github.com/Xunnamius/next-test-api-route-handler/blob/43eec5385cb48f619257324a2fe1b54d29748ff1/src/index.ts#L224)
27+
[index.ts:224](https://github.com/Xunnamius/next-test-api-route-handler/blob/89d2409a8fbc9ba840b27d51fe118ce111e6c10f/src/index.ts#L224)
2828

2929
***
3030

@@ -40,9 +40,9 @@ Note that type checking for `res.send` and similar methods was retired in
4040
NTARH@4. Only the `response.json` method returned by NTARH's fetch wrapper
4141
will have a typed result.
4242

43-
#### Source
43+
#### Defined in
4444

45-
[index.ts:223](https://github.com/Xunnamius/next-test-api-route-handler/blob/43eec5385cb48f619257324a2fe1b54d29748ff1/src/index.ts#L223)
45+
[index.ts:223](https://github.com/Xunnamius/next-test-api-route-handler/blob/89d2409a8fbc9ba840b27d51fe118ce111e6c10f/src/index.ts#L223)
4646

4747
***
4848

@@ -58,9 +58,9 @@ handled automatically.
5858
params.id = 'some-id' }`. This is useful for quickly setting many params at
5959
once.
6060

61-
#### Source
61+
#### Defined in
6262

63-
[index.ts:234](https://github.com/Xunnamius/next-test-api-route-handler/blob/43eec5385cb48f619257324a2fe1b54d29748ff1/src/index.ts#L234)
63+
[index.ts:234](https://github.com/Xunnamius/next-test-api-route-handler/blob/89d2409a8fbc9ba840b27d51fe118ce111e6c10f/src/index.ts#L234)
6464

6565
***
6666

@@ -84,9 +84,9 @@ is handled automatically.
8484

8585
[`Promisable`](../type-aliases/Promisable.md)\<`void` \| `Record`\<`string`, `unknown`\>\>
8686

87-
#### Source
87+
#### Defined in
8888

89-
[index.ts:244](https://github.com/Xunnamius/next-test-api-route-handler/blob/43eec5385cb48f619257324a2fe1b54d29748ff1/src/index.ts#L244)
89+
[index.ts:244](https://github.com/Xunnamius/next-test-api-route-handler/blob/89d2409a8fbc9ba840b27d51fe118ce111e6c10f/src/index.ts#L244)
9090

9191
***
9292

@@ -113,9 +113,9 @@ false
113113

114114
[`NtarhInit`](NtarhInit.md).[`rejectOnHandlerError`](NtarhInit.md#rejectonhandlererror)
115115

116-
#### Source
116+
#### Defined in
117117

118-
[index.ts:123](https://github.com/Xunnamius/next-test-api-route-handler/blob/43eec5385cb48f619257324a2fe1b54d29748ff1/src/index.ts#L123)
118+
[index.ts:123](https://github.com/Xunnamius/next-test-api-route-handler/blob/89d2409a8fbc9ba840b27d51fe118ce111e6c10f/src/index.ts#L123)
119119

120120
***
121121

@@ -137,9 +137,9 @@ lowercase.**
137137

138138
[`Promisable`](../type-aliases/Promisable.md)\<`void`\>
139139

140-
#### Source
140+
#### Defined in
141141

142-
[index.ts:255](https://github.com/Xunnamius/next-test-api-route-handler/blob/43eec5385cb48f619257324a2fe1b54d29748ff1/src/index.ts#L255)
142+
[index.ts:255](https://github.com/Xunnamius/next-test-api-route-handler/blob/89d2409a8fbc9ba840b27d51fe118ce111e6c10f/src/index.ts#L255)
143143

144144
***
145145

@@ -158,9 +158,9 @@ to edit the response _before_ it's injected into the handler.
158158

159159
[`Promisable`](../type-aliases/Promisable.md)\<`void`\>
160160

161-
#### Source
161+
#### Defined in
162162

163-
[index.ts:260](https://github.com/Xunnamius/next-test-api-route-handler/blob/43eec5385cb48f619257324a2fe1b54d29748ff1/src/index.ts#L260)
163+
[index.ts:260](https://github.com/Xunnamius/next-test-api-route-handler/blob/89d2409a8fbc9ba840b27d51fe118ce111e6c10f/src/index.ts#L260)
164164

165165
***
166166

@@ -186,9 +186,9 @@ one destructured parameter: `fetch`, which is equivalent to
186186

187187
[`NtarhInit`](NtarhInit.md).[`test`](NtarhInit.md#test)
188188

189-
#### Source
189+
#### Defined in
190190

191-
[index.ts:129](https://github.com/Xunnamius/next-test-api-route-handler/blob/43eec5385cb48f619257324a2fe1b54d29748ff1/src/index.ts#L129)
191+
[index.ts:129](https://github.com/Xunnamius/next-test-api-route-handler/blob/89d2409a8fbc9ba840b27d51fe118ce111e6c10f/src/index.ts#L129)
192192

193193
***
194194

@@ -199,6 +199,6 @@ one destructured parameter: `fetch`, which is equivalent to
199199
`url: 'your-url'` is shorthand for `requestPatcher: (req) => { req.url =
200200
'your-url' }`
201201

202-
#### Source
202+
#### Defined in
203203

204-
[index.ts:265](https://github.com/Xunnamius/next-test-api-route-handler/blob/43eec5385cb48f619257324a2fe1b54d29748ff1/src/index.ts#L265)
204+
[index.ts:265](https://github.com/Xunnamius/next-test-api-route-handler/blob/89d2409a8fbc9ba840b27d51fe118ce111e6c10f/src/index.ts#L265)

docs/type-aliases/FetchReturnType.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@
44

55
[next-test-api-route-handler](../README.md) / FetchReturnType
66

7-
# Type alias: FetchReturnType\<NextResponseJsonType\>
8-
9-
`Internal`
7+
# Type Alias: FetchReturnType\<NextResponseJsonType\>
108

119
> **FetchReturnType**\<`NextResponseJsonType`\>: `Promise`\<`Omit`\<`Response`, `"json"`\> & `object`\>
1210
13-
## Type parameters
11+
**`Internal`**
12+
13+
## Type Parameters
1414

1515
**NextResponseJsonType**
1616

17-
## Source
17+
## Defined in
1818

19-
[index.ts:100](https://github.com/Xunnamius/next-test-api-route-handler/blob/43eec5385cb48f619257324a2fe1b54d29748ff1/src/index.ts#L100)
19+
[index.ts:100](https://github.com/Xunnamius/next-test-api-route-handler/blob/89d2409a8fbc9ba840b27d51fe118ce111e6c10f/src/index.ts#L100)

docs/type-aliases/Promisable.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@
44

55
[next-test-api-route-handler](../README.md) / Promisable
66

7-
# Type alias: Promisable\<Promised\>
8-
9-
`Internal`
7+
# Type Alias: Promisable\<Promised\>
108

119
> **Promisable**\<`Promised`\>: `Promised` \| `Promise`\<`Promised`\>
1210
13-
## Type parameters
11+
**`Internal`**
12+
13+
## Type Parameters
1414

1515
**Promised**
1616

17-
## Source
17+
## Defined in
1818

19-
[index.ts:95](https://github.com/Xunnamius/next-test-api-route-handler/blob/43eec5385cb48f619257324a2fe1b54d29748ff1/src/index.ts#L95)
19+
[index.ts:95](https://github.com/Xunnamius/next-test-api-route-handler/blob/89d2409a8fbc9ba840b27d51fe118ce111e6c10f/src/index.ts#L95)

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": "4.0.8",
3+
"version": "4.0.9",
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)