|
1 | | -[next-test-api-route-handler](../README.md) / NtarhInit |
2 | | - |
3 | | -# Interface: NtarhInit\<NextResponseJsonType\> |
4 | | - |
5 | | -## Type parameters |
| 1 | +[**next-test-api-route-handler**](../README.md) • **Docs** |
6 | 2 |
|
7 | | -| Name | Type | |
8 | | -| :------ | :------ | |
9 | | -| `NextResponseJsonType` | `unknown` | |
| 3 | +*** |
10 | 4 |
|
11 | | -## Hierarchy |
12 | | - |
13 | | -- **`NtarhInit`** |
| 5 | +[next-test-api-route-handler](../README.md) / NtarhInit |
14 | 6 |
|
15 | | - ↳ [`NtarhInitAppRouter`](NtarhInitAppRouter.md) |
| 7 | +# Interface: NtarhInit\<NextResponseJsonType\> |
16 | 8 |
|
17 | | - ↳ [`NtarhInitPagesRouter`](NtarhInitPagesRouter.md) |
| 9 | +## Extended by |
18 | 10 |
|
19 | | -## Table of contents |
| 11 | +- [`NtarhInitAppRouter`](NtarhInitAppRouter.md) |
| 12 | +- [`NtarhInitPagesRouter`](NtarhInitPagesRouter.md) |
20 | 13 |
|
21 | | -### Properties |
| 14 | +## Type parameters |
22 | 15 |
|
23 | | -- [rejectOnHandlerError](NtarhInit.md#rejectonhandlererror) |
24 | | -- [test](NtarhInit.md#test) |
| 16 | +• **NextResponseJsonType** = `unknown` |
25 | 17 |
|
26 | 18 | ## Properties |
27 | 19 |
|
28 | | -### rejectOnHandlerError |
| 20 | +### rejectOnHandlerError? |
29 | 21 |
|
30 | | -• `Optional` **rejectOnHandlerError**: `boolean` |
| 22 | +> `optional` **rejectOnHandlerError**: `boolean` |
31 | 23 |
|
32 | 24 | If `false`, errors thrown from within a handler are kicked up to Next.js's |
33 | 25 | resolver to deal with, which is what would happen in production. If `true`, |
34 | | -the [testApiHandler](../README.md#testapihandler) function will reject immediately instead. |
| 26 | +the [testApiHandler](../functions/testApiHandler.md) function will reject immediately instead. |
35 | 27 |
|
36 | 28 | You should use `rejectOnHandlerError` whenever you want to manually handle |
37 | 29 | an error that bubbles up from your handler (which is especially true if |
38 | 30 | you're using `expect` _within_ your handler) or when you notice a false |
39 | 31 | negative despite exceptions being thrown. |
40 | 32 |
|
41 | | -**`Default`** |
| 33 | +#### Default |
42 | 34 |
|
43 | 35 | ```ts |
44 | 36 | false |
45 | 37 | ``` |
46 | 38 |
|
47 | | -#### Defined in |
| 39 | +#### Source |
48 | 40 |
|
49 | | -[index.ts:123](https://github.com/Xunnamius/next-test-api-route-handler/blob/b7621d6b938246e73d656a1f9516def892b70ed0/src/index.ts#L123) |
| 41 | +[index.ts:123](https://github.com/Xunnamius/next-test-api-route-handler/blob/43eec5385cb48f619257324a2fe1b54d29748ff1/src/index.ts#L123) |
50 | 42 |
|
51 | | -___ |
| 43 | +*** |
52 | 44 |
|
53 | | -### test |
| 45 | +### test() |
54 | 46 |
|
55 | | -• **test**: (`parameters`: \{ `fetch`: (`customInit?`: `RequestInit`) => [`FetchReturnType`](../README.md#fetchreturntype)\<`NextResponseJsonType`\> }) => [`Promisable`](../README.md#promisable)\<`void`\> |
| 47 | +> **test**: (`parameters`) => [`Promisable`](../type-aliases/Promisable.md)\<`void`\> |
56 | 48 |
|
57 | 49 | `test` is a function that runs your test assertions. This function receives |
58 | 50 | one destructured parameter: `fetch`, which is equivalent to |
59 | 51 | `globalThis.fetch` but with the first parameter omitted. |
60 | 52 |
|
61 | | -#### Type declaration |
62 | | - |
63 | | -▸ (`parameters`): [`Promisable`](../README.md#promisable)\<`void`\> |
| 53 | +#### Parameters |
64 | 54 |
|
65 | | -##### Parameters |
| 55 | +• **parameters** |
66 | 56 |
|
67 | | -| Name | Type | |
68 | | -| :------ | :------ | |
69 | | -| `parameters` | `Object` | |
70 | | -| `parameters.fetch` | (`customInit?`: `RequestInit`) => [`FetchReturnType`](../README.md#fetchreturntype)\<`NextResponseJsonType`\> | |
| 57 | +• **parameters.fetch** |
71 | 58 |
|
72 | | -##### Returns |
| 59 | +#### Returns |
73 | 60 |
|
74 | | -[`Promisable`](../README.md#promisable)\<`void`\> |
| 61 | +[`Promisable`](../type-aliases/Promisable.md)\<`void`\> |
75 | 62 |
|
76 | | -#### Defined in |
| 63 | +#### Source |
77 | 64 |
|
78 | | -[index.ts:129](https://github.com/Xunnamius/next-test-api-route-handler/blob/b7621d6b938246e73d656a1f9516def892b70ed0/src/index.ts#L129) |
| 65 | +[index.ts:129](https://github.com/Xunnamius/next-test-api-route-handler/blob/43eec5385cb48f619257324a2fe1b54d29748ff1/src/index.ts#L129) |
0 commit comments