@jterrazz/test 16.0.0 → 16.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/appium.adapter.js +59 -4
- package/dist/browser/index.js +88 -40
- package/dist/checker.js +272 -63
- package/dist/index.d.ts +33 -4
- package/dist/index.js +47 -24
- package/dist/oxlint.cjs +100 -27
- package/dist/oxlint.js +100 -27
- package/dist/playwright.adapter.js +14 -65
- package/dist/{ambiguity.js → substring-warning.js} +99 -1
- package/dist/vitest.js +71 -11
- package/docs/01-architecture.md +95 -0
- package/docs/02-developing.md +351 -0
- package/docs/03-testing.md +495 -0
- package/docs/04-operating.md +101 -0
- package/docs/05-module-tests.md +152 -0
- package/docs/06-integration.md +180 -0
- package/docs/07-component.md +246 -0
- package/docs/08-website.md +404 -0
- package/docs/09-mobile.md +270 -0
- package/docs/10-api.md +264 -0
- package/docs/11-jobs.md +157 -0
- package/docs/12-cli.md +677 -0
- package/docs/13-elements.md +242 -0
- package/docs/14-assertions.md +314 -0
- package/docs/15-tokens.md +253 -0
- package/docs/16-contracts.md +438 -0
- package/docs/17-services.md +188 -0
- package/docs/18-conventions.md +305 -0
- package/docs/19-linting.md +510 -0
- package/docs/README.md +36 -0
- package/docs/decisions/001-v9-conventions-on-three-channels.md +50 -0
- package/docs/decisions/002-the-statique-channel-holds-only-what-upstream-does-not.md +49 -0
- package/docs/decisions/003-a-rendered-component-is-a-facet-on-vitest-browser-mode.md +84 -0
- package/docs/decisions/004-a-module-against-real-services-or-a-golden-is-the-integration-facet.md +81 -0
- package/docs/decisions/005-the-doubles-ladder-is-closed.md +86 -0
- package/docs/decisions/006-the-catalogue-reaches-a-file-by-its-role.md +245 -0
- package/docs/decisions/007-compose-mode-leaves-the-package.md +53 -0
- package/docs/decisions/008-vitest-5-node-24-and-the-native-seams-as-optional-peers.md +75 -0
- package/docs/decisions/_template.md +22 -0
- package/docs/reference/classes/Matcher.md +120 -0
- package/docs/reference/classes/ProcessHandle.md +368 -0
- package/docs/reference/functions/defineContract.md +39 -0
- package/docs/reference/functions/defineContracts.md +36 -0
- package/docs/reference/functions/disabled.md +28 -0
- package/docs/reference/functions/enabled.md +20 -0
- package/docs/reference/functions/focused.md +26 -0
- package/docs/reference/functions/mockOf.md +79 -0
- package/docs/reference/functions/postgres.md +31 -0
- package/docs/reference/functions/process.md +33 -0
- package/docs/reference/functions/redis.md +28 -0
- package/docs/reference/functions/required.md +41 -0
- package/docs/reference/functions/selected.md +26 -0
- package/docs/reference/functions/sqlite.md +33 -0
- package/docs/reference/functions/testId.md +20 -0
- package/docs/reference/functions/text.md +40 -0
- package/docs/reference/functions/valued.md +28 -0
- package/docs/reference/functions/waitUntil.md +46 -0
- package/docs/reference/functions/within.md +29 -0
- package/docs/reference/index.md +196 -0
- package/docs/reference/interfaces/BaseResult.md +87 -0
- package/docs/reference/interfaces/CallResult.md +160 -0
- package/docs/reference/interfaces/CaptureScope.md +82 -0
- package/docs/reference/interfaces/CliResult.md +253 -0
- package/docs/reference/interfaces/ContainerAccessor.md +166 -0
- package/docs/reference/interfaces/DirectoryAccessor.md +33 -0
- package/docs/reference/interfaces/FetchResult.md +180 -0
- package/docs/reference/interfaces/FilesystemAccessor.md +46 -0
- package/docs/reference/interfaces/HttpResult.md +126 -0
- package/docs/reference/interfaces/JsonAccessor.md +46 -0
- package/docs/reference/interfaces/PageResult.md +356 -0
- package/docs/reference/interfaces/RenderResult.md +72 -0
- package/docs/reference/interfaces/RenderedText.md +110 -0
- package/docs/reference/interfaces/ResponseAccessor.md +47 -0
- package/docs/reference/interfaces/ScreenResult.md +128 -0
- package/docs/reference/interfaces/TableAccessor.md +26 -0
- package/docs/reference/interfaces/TextAccessor.md +96 -0
- package/docs/reference/type-aliases/ApiHandle.md +68 -0
- package/docs/reference/type-aliases/ApiSpecification.md +213 -0
- package/docs/reference/type-aliases/ApiSpecificationOptions.md +68 -0
- package/docs/reference/type-aliases/BrowserConsoleMessage.md +30 -0
- package/docs/reference/type-aliases/BrowserLinkElement.md +50 -0
- package/docs/reference/type-aliases/BrowserMetaElement.md +40 -0
- package/docs/reference/type-aliases/BrowserOpenOptions.md +87 -0
- package/docs/reference/type-aliases/BrowserPage.md +132 -0
- package/docs/reference/type-aliases/BrowserPort.md +51 -0
- package/docs/reference/type-aliases/CliEnv.md +11 -0
- package/docs/reference/type-aliases/CliHandle.md +80 -0
- package/docs/reference/type-aliases/CliInput.md +36 -0
- package/docs/reference/type-aliases/CliOutput.md +46 -0
- package/docs/reference/type-aliases/CliPort.md +58 -0
- package/docs/reference/type-aliases/CliSpecification.md +144 -0
- package/docs/reference/type-aliases/CliSpecificationOptions.md +134 -0
- package/docs/reference/type-aliases/ComponentChain.md +156 -0
- package/docs/reference/type-aliases/ComponentScenario.md +20 -0
- package/docs/reference/type-aliases/ComponentUi.md +47 -0
- package/docs/reference/type-aliases/ComponentVisitor.md +10 -0
- package/docs/reference/type-aliases/ContainerPort.md +113 -0
- package/docs/reference/type-aliases/Contract.md +68 -0
- package/docs/reference/type-aliases/ContractInput.md +13 -0
- package/docs/reference/type-aliases/ContractRequest.md +95 -0
- package/docs/reference/type-aliases/ContractResponder.md +23 -0
- package/docs/reference/type-aliases/ContractResponse.md +78 -0
- package/docs/reference/type-aliases/ContractResponseValue.md +13 -0
- package/docs/reference/type-aliases/Contracts.md +48 -0
- package/docs/reference/type-aliases/DatabaseKeys.md +16 -0
- package/docs/reference/type-aliases/DatabasePort.md +72 -0
- package/docs/reference/type-aliases/DeviceOpenOptions.md +46 -0
- package/docs/reference/type-aliases/DevicePort.md +51 -0
- package/docs/reference/type-aliases/DeviceScreen.md +32 -0
- package/docs/reference/type-aliases/DeviceTimeouts.md +39 -0
- package/docs/reference/type-aliases/DockerSpecConfig.md +43 -0
- package/docs/reference/type-aliases/DomMount.md +21 -0
- package/docs/reference/type-aliases/ElementKind.md +27 -0
- package/docs/reference/type-aliases/ElementMatch.md +74 -0
- package/docs/reference/type-aliases/ElementOptions.md +29 -0
- package/docs/reference/type-aliases/ElementRef.md +128 -0
- package/docs/reference/type-aliases/ExecOptions.md +37 -0
- package/docs/reference/type-aliases/FileAccessor.md +54 -0
- package/docs/reference/type-aliases/HonoApp.md +31 -0
- package/docs/reference/type-aliases/HttpContractFilter.md +49 -0
- package/docs/reference/type-aliases/HttpResponseInit.md +46 -0
- package/docs/reference/type-aliases/HttpStreamInit.md +58 -0
- package/docs/reference/type-aliases/IntegrationHandle.md +46 -0
- package/docs/reference/type-aliases/IntegrationSpecification.md +111 -0
- package/docs/reference/type-aliases/IntegrationSpecificationOptions.md +42 -0
- package/docs/reference/type-aliases/Intercept.md +19 -0
- package/docs/reference/type-aliases/InterceptOptions.md +28 -0
- package/docs/reference/type-aliases/InterceptScope.md +11 -0
- package/docs/reference/type-aliases/IsolationStrategy.md +75 -0
- package/docs/reference/type-aliases/JobHandle.md +34 -0
- package/docs/reference/type-aliases/JobsHandle.md +57 -0
- package/docs/reference/type-aliases/JobsResult.md +16 -0
- package/docs/reference/type-aliases/JobsSpecification.md +94 -0
- package/docs/reference/type-aliases/JobsSpecificationOptions.md +56 -0
- package/docs/reference/type-aliases/LandmarkKind.md +20 -0
- package/docs/reference/type-aliases/LiterateRunFlags.md +27 -0
- package/docs/reference/type-aliases/LiterateServeRegistration.md +70 -0
- package/docs/reference/type-aliases/MatchFixtureOptions.md +27 -0
- package/docs/reference/type-aliases/MatchableRequest.md +61 -0
- package/docs/reference/type-aliases/MatcherKind.md +34 -0
- package/docs/reference/type-aliases/MobileBackendOptions.md +28 -0
- package/docs/reference/type-aliases/MobileElementKind.md +14 -0
- package/docs/reference/type-aliases/MobileElementMatch.md +60 -0
- package/docs/reference/type-aliases/MobileElementRef.md +20 -0
- package/docs/reference/type-aliases/MobileHandle.md +65 -0
- package/docs/reference/type-aliases/MobileScenario.md +20 -0
- package/docs/reference/type-aliases/MobileSpecification.md +51 -0
- package/docs/reference/type-aliases/MobileSpecificationOptions.md +126 -0
- package/docs/reference/type-aliases/MobileVisitor.md +81 -0
- package/docs/reference/type-aliases/MockOfOptions.md +26 -0
- package/docs/reference/type-aliases/MockPort.md +10 -0
- package/docs/reference/type-aliases/PinnedClock.md +10 -0
- package/docs/reference/type-aliases/PostgresOptions.md +32 -0
- package/docs/reference/type-aliases/ProcessOptions.md +112 -0
- package/docs/reference/type-aliases/RedisOptions.md +20 -0
- package/docs/reference/type-aliases/RenderSubject.md +12 -0
- package/docs/reference/type-aliases/ScreenNode.md +67 -0
- package/docs/reference/type-aliases/ServerPort.md +36 -0
- package/docs/reference/type-aliases/ServerResponse.md +46 -0
- package/docs/reference/type-aliases/ServerSpec.md +21 -0
- package/docs/reference/type-aliases/ServiceHandle.md +216 -0
- package/docs/reference/type-aliases/ServiceRecord.md +12 -0
- package/docs/reference/type-aliases/SpecDocument.md +84 -0
- package/docs/reference/type-aliases/SpecEnvToken.md +21 -0
- package/docs/reference/type-aliases/SpecFileAssertion.md +27 -0
- package/docs/reference/type-aliases/SpecFixture.md +30 -0
- package/docs/reference/type-aliases/SpecKind.md +8 -0
- package/docs/reference/type-aliases/SpecRun.md +108 -0
- package/docs/reference/type-aliases/SpecServeEntry.md +40 -0
- package/docs/reference/type-aliases/SpecStream.md +32 -0
- package/docs/reference/type-aliases/SpecificationConfig.md +290 -0
- package/docs/reference/type-aliases/SqliteOptions.md +36 -0
- package/docs/reference/type-aliases/SseEvent.md +58 -0
- package/docs/reference/type-aliases/StreamBody.md +61 -0
- package/docs/reference/type-aliases/TextFilter.md +22 -0
- package/docs/reference/type-aliases/VisitScenario.md +20 -0
- package/docs/reference/type-aliases/Visitor.md +215 -0
- package/docs/reference/type-aliases/WaitUntilOptions.md +46 -0
- package/docs/reference/type-aliases/WebsiteBackendOptions.md +37 -0
- package/docs/reference/type-aliases/WebsiteHandle.md +51 -0
- package/docs/reference/type-aliases/WebsiteSpecification.md +118 -0
- package/docs/reference/type-aliases/WebsiteSpecificationOptions.md +40 -0
- package/docs/reference/variables/anthropic.md +19 -0
- package/docs/reference/variables/banner.md +10 -0
- package/docs/reference/variables/button.md +10 -0
- package/docs/reference/variables/clock.md +16 -0
- package/docs/reference/variables/complementary.md +10 -0
- package/docs/reference/variables/component.md +10 -0
- package/docs/reference/variables/content.md +10 -0
- package/docs/reference/variables/contentinfo.md +10 -0
- package/docs/reference/variables/dialog.md +10 -0
- package/docs/reference/variables/field.md +10 -0
- package/docs/reference/variables/form.md +10 -0
- package/docs/reference/variables/heading.md +10 -0
- package/docs/reference/variables/http.md +40 -0
- package/docs/reference/variables/intercept.md +11 -0
- package/docs/reference/variables/link.md +10 -0
- package/docs/reference/variables/listitem.md +10 -0
- package/docs/reference/variables/main.md +10 -0
- package/docs/reference/variables/match.md +8 -0
- package/docs/reference/variables/navigation.md +10 -0
- package/docs/reference/variables/openai.md +21 -0
- package/docs/reference/variables/option.md +17 -0
- package/docs/reference/variables/region.md +10 -0
- package/docs/reference/variables/row.md +10 -0
- package/docs/reference/variables/search.md +10 -0
- package/docs/reference/variables/specification.md +8 -0
- package/docs/reference/variables/status.md +10 -0
- package/docs/reference/variables/table.md +10 -0
- package/package.json +2 -1
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
<!-- GENERATED by `typescript docs` — DO NOT EDIT -->
|
|
2
|
+
# Type Alias: ComponentChain
|
|
3
|
+
|
|
4
|
+
```ts
|
|
5
|
+
type ComponentChain = object;
|
|
6
|
+
```
|
|
7
|
+
|
|
8
|
+
Defined in: [src/facets/component/component.types.ts:37](https://github.com/jterrazz/package-test/blob/main/src/facets/component/component.types.ts#L37)
|
|
9
|
+
|
|
10
|
+
The chain. Every setup returns a new one, so the handle a spec imports never
|
|
11
|
+
carries the previous test's contracts, wrapper or clock.
|
|
12
|
+
|
|
13
|
+
## Properties
|
|
14
|
+
|
|
15
|
+
### clock
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
clock: (iso) => ComponentChain;
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Defined in: [src/facets/component/component.types.ts:39](https://github.com/jterrazz/package-test/blob/main/src/facets/component/component.types.ts#L39)
|
|
22
|
+
|
|
23
|
+
Pin the page's `Date` for this render — the clock the component reads.
|
|
24
|
+
|
|
25
|
+
#### Parameters
|
|
26
|
+
|
|
27
|
+
| Parameter | Type |
|
|
28
|
+
| ------ | ------ |
|
|
29
|
+
| `iso` | `string` |
|
|
30
|
+
|
|
31
|
+
#### Returns
|
|
32
|
+
|
|
33
|
+
`ComponentChain`
|
|
34
|
+
|
|
35
|
+
***
|
|
36
|
+
|
|
37
|
+
### intercept
|
|
38
|
+
|
|
39
|
+
```ts
|
|
40
|
+
intercept: {
|
|
41
|
+
(contracts): ComponentChain;
|
|
42
|
+
(request, response): ComponentChain;
|
|
43
|
+
};
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Defined in: [src/facets/component/component.types.ts:45](https://github.com/jterrazz/package-test/blob/main/src/facets/component/component.types.ts#L45)
|
|
47
|
+
|
|
48
|
+
Declare what the network replies — the same contracts, the same queue
|
|
49
|
+
and the same strictness as every other facet (D7), served by msw's
|
|
50
|
+
worker instead of its node interceptor.
|
|
51
|
+
|
|
52
|
+
#### Call Signature
|
|
53
|
+
|
|
54
|
+
```ts
|
|
55
|
+
(contracts): ComponentChain;
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
##### Parameters
|
|
59
|
+
|
|
60
|
+
| Parameter | Type |
|
|
61
|
+
| ------ | ------ |
|
|
62
|
+
| `contracts` | [`ContractInput`](ContractInput.md) |
|
|
63
|
+
|
|
64
|
+
##### Returns
|
|
65
|
+
|
|
66
|
+
`ComponentChain`
|
|
67
|
+
|
|
68
|
+
#### Call Signature
|
|
69
|
+
|
|
70
|
+
```ts
|
|
71
|
+
(request, response): ComponentChain;
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
##### Parameters
|
|
75
|
+
|
|
76
|
+
| Parameter | Type |
|
|
77
|
+
| ------ | ------ |
|
|
78
|
+
| `request` | [`ContractRequest`](ContractRequest.md) |
|
|
79
|
+
| `response` | \| [`ContractResponse`](ContractResponse.md) \| [`ContractResponder`](ContractResponder.md) |
|
|
80
|
+
|
|
81
|
+
##### Returns
|
|
82
|
+
|
|
83
|
+
`ComponentChain`
|
|
84
|
+
|
|
85
|
+
***
|
|
86
|
+
|
|
87
|
+
### render
|
|
88
|
+
|
|
89
|
+
```ts
|
|
90
|
+
render: (subject, scenario?) => Promise<RenderResult>;
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Defined in: [src/facets/component/component.types.ts:50](https://github.com/jterrazz/package-test/blob/main/src/facets/component/component.types.ts#L50)
|
|
94
|
+
|
|
95
|
+
Mount the subject, run the scenario, and capture what the page shows.
|
|
96
|
+
|
|
97
|
+
#### Parameters
|
|
98
|
+
|
|
99
|
+
| Parameter | Type |
|
|
100
|
+
| ------ | ------ |
|
|
101
|
+
| `subject` | [`RenderSubject`](RenderSubject.md) |
|
|
102
|
+
| `scenario?` | [`ComponentScenario`](ComponentScenario.md) |
|
|
103
|
+
|
|
104
|
+
#### Returns
|
|
105
|
+
|
|
106
|
+
`Promise`\<[`RenderResult`](../interfaces/RenderResult.md)\>
|
|
107
|
+
|
|
108
|
+
***
|
|
109
|
+
|
|
110
|
+
### viewport
|
|
111
|
+
|
|
112
|
+
```ts
|
|
113
|
+
viewport: (size) => ComponentChain;
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Defined in: [src/facets/component/component.types.ts:56](https://github.com/jterrazz/package-test/blob/main/src/facets/component/component.types.ts#L56)
|
|
117
|
+
|
|
118
|
+
The page size THIS render gets — the Given of a component that reads
|
|
119
|
+
`matchMedia` or a container query. The project's size is restored when
|
|
120
|
+
the test ends, so a narrow render never leaks into the next one.
|
|
121
|
+
|
|
122
|
+
#### Parameters
|
|
123
|
+
|
|
124
|
+
| Parameter | Type |
|
|
125
|
+
| ------ | ------ |
|
|
126
|
+
| `size` | \{ `height`: `number`; `width`: `number`; \} |
|
|
127
|
+
| `size.height` | `number` |
|
|
128
|
+
| `size.width` | `number` |
|
|
129
|
+
|
|
130
|
+
#### Returns
|
|
131
|
+
|
|
132
|
+
`ComponentChain`
|
|
133
|
+
|
|
134
|
+
***
|
|
135
|
+
|
|
136
|
+
### wrap
|
|
137
|
+
|
|
138
|
+
```ts
|
|
139
|
+
wrap: (wrapper) => ComponentChain;
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
Defined in: [src/facets/component/component.types.ts:62](https://github.com/jterrazz/package-test/blob/main/src/facets/component/component.types.ts#L62)
|
|
143
|
+
|
|
144
|
+
Wrap every render of this chain — the test-local Given a router stub or
|
|
145
|
+
a `<StrictMode>` is. The project's own `wrap` stays outermost: it is the
|
|
146
|
+
app's frame, and one test does not get to sit outside it.
|
|
147
|
+
|
|
148
|
+
#### Parameters
|
|
149
|
+
|
|
150
|
+
| Parameter | Type |
|
|
151
|
+
| ------ | ------ |
|
|
152
|
+
| `wrapper` | (`ui`) => [`ComponentUi`](ComponentUi.md) |
|
|
153
|
+
|
|
154
|
+
#### Returns
|
|
155
|
+
|
|
156
|
+
`ComponentChain`
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<!-- GENERATED by `typescript docs` — DO NOT EDIT -->
|
|
2
|
+
# Type Alias: ComponentScenario
|
|
3
|
+
|
|
4
|
+
```ts
|
|
5
|
+
type ComponentScenario = (visitor) => Promise<void>;
|
|
6
|
+
```
|
|
7
|
+
|
|
8
|
+
Defined in: [src/facets/component/component.types.ts:24](https://github.com/jterrazz/package-test/blob/main/src/facets/component/component.types.ts#L24)
|
|
9
|
+
|
|
10
|
+
The behaviour of a render; assertions stay in the Then, on the result (W1).
|
|
11
|
+
|
|
12
|
+
## Parameters
|
|
13
|
+
|
|
14
|
+
| Parameter | Type |
|
|
15
|
+
| ------ | ------ |
|
|
16
|
+
| `visitor` | [`ComponentVisitor`](ComponentVisitor.md) |
|
|
17
|
+
|
|
18
|
+
## Returns
|
|
19
|
+
|
|
20
|
+
`Promise`\<`void`\>
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<!-- GENERATED by `typescript docs` — DO NOT EDIT -->
|
|
2
|
+
# Type Alias: ComponentUi
|
|
3
|
+
|
|
4
|
+
```ts
|
|
5
|
+
type ComponentUi =
|
|
6
|
+
| ReactElement
|
|
7
|
+
| string
|
|
8
|
+
| number
|
|
9
|
+
| bigint
|
|
10
|
+
| Iterable<ReactNode>
|
|
11
|
+
| ReactPortal
|
|
12
|
+
| boolean
|
|
13
|
+
| null
|
|
14
|
+
| undefined
|
|
15
|
+
| DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_REACT_NODES[keyof DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_REACT_NODES]
|
|
16
|
+
| Promise<AwaitedReactNode>;
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Defined in: node\_modules/@types/react/index.d.ts:436
|
|
20
|
+
|
|
21
|
+
Represents all of the things React can render.
|
|
22
|
+
|
|
23
|
+
Where ReactElement only represents JSX, `ReactNode` represents everything that can be rendered.
|
|
24
|
+
|
|
25
|
+
## See
|
|
26
|
+
|
|
27
|
+
[React TypeScript Cheatsheet](https://react-typescript-cheatsheet.netlify.app/docs/reference/reactnode/)
|
|
28
|
+
|
|
29
|
+
## Examples
|
|
30
|
+
|
|
31
|
+
```tsx
|
|
32
|
+
// Typing children
|
|
33
|
+
type Props = { children: ReactNode }
|
|
34
|
+
|
|
35
|
+
const Component = ({ children }: Props) => <div>{children}</div>
|
|
36
|
+
|
|
37
|
+
<Component>hello</Component>
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
```tsx
|
|
41
|
+
// Typing a custom element
|
|
42
|
+
type Props = { customElement: ReactNode }
|
|
43
|
+
|
|
44
|
+
const Component = ({ customElement }: Props) => <div>{customElement}</div>
|
|
45
|
+
|
|
46
|
+
<Component customElement={<div>hello</div>} />
|
|
47
|
+
```
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<!-- GENERATED by `typescript docs` — DO NOT EDIT -->
|
|
2
|
+
# Type Alias: ComponentVisitor
|
|
3
|
+
|
|
4
|
+
```ts
|
|
5
|
+
type ComponentVisitor = ReturnType<typeof componentVerbs>;
|
|
6
|
+
```
|
|
7
|
+
|
|
8
|
+
Defined in: [src/facets/component/component.types.ts:21](https://github.com/jterrazz/package-test/blob/main/src/facets/component/component.types.ts#L21)
|
|
9
|
+
|
|
10
|
+
The interaction vocabulary a render scenario is handed — the When.
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
<!-- GENERATED by `typescript docs` — DO NOT EDIT -->
|
|
2
|
+
# Type Alias: ContainerPort
|
|
3
|
+
|
|
4
|
+
```ts
|
|
5
|
+
type ContainerPort = object;
|
|
6
|
+
```
|
|
7
|
+
|
|
8
|
+
Defined in: [src/model/ports/container.port.ts:5](https://github.com/jterrazz/package-test/blob/main/src/model/ports/container.port.ts#L5)
|
|
9
|
+
|
|
10
|
+
Abstract container interface.
|
|
11
|
+
Represents a running service (database, cache, etc.)
|
|
12
|
+
|
|
13
|
+
## Properties
|
|
14
|
+
|
|
15
|
+
### getConnectionString
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
getConnectionString: () => string;
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Defined in: [src/model/ports/container.port.ts:19](https://github.com/jterrazz/package-test/blob/main/src/model/ports/container.port.ts#L19)
|
|
22
|
+
|
|
23
|
+
Get a full connection string for this service.
|
|
24
|
+
|
|
25
|
+
#### Returns
|
|
26
|
+
|
|
27
|
+
`string`
|
|
28
|
+
|
|
29
|
+
***
|
|
30
|
+
|
|
31
|
+
### getHost
|
|
32
|
+
|
|
33
|
+
```ts
|
|
34
|
+
getHost: () => string;
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Defined in: [src/model/ports/container.port.ts:16](https://github.com/jterrazz/package-test/blob/main/src/model/ports/container.port.ts#L16)
|
|
38
|
+
|
|
39
|
+
Get the host to connect to.
|
|
40
|
+
|
|
41
|
+
#### Returns
|
|
42
|
+
|
|
43
|
+
`string`
|
|
44
|
+
|
|
45
|
+
***
|
|
46
|
+
|
|
47
|
+
### getLogs
|
|
48
|
+
|
|
49
|
+
```ts
|
|
50
|
+
getLogs: () => Promise<string>;
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Defined in: [src/model/ports/container.port.ts:22](https://github.com/jterrazz/package-test/blob/main/src/model/ports/container.port.ts#L22)
|
|
54
|
+
|
|
55
|
+
Get container logs (stdout + stderr).
|
|
56
|
+
|
|
57
|
+
#### Returns
|
|
58
|
+
|
|
59
|
+
`Promise`\<`string`\>
|
|
60
|
+
|
|
61
|
+
***
|
|
62
|
+
|
|
63
|
+
### getMappedPort
|
|
64
|
+
|
|
65
|
+
```ts
|
|
66
|
+
getMappedPort: (containerPort) => number;
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Defined in: [src/model/ports/container.port.ts:13](https://github.com/jterrazz/package-test/blob/main/src/model/ports/container.port.ts#L13)
|
|
70
|
+
|
|
71
|
+
Get the mapped host port for a container port.
|
|
72
|
+
|
|
73
|
+
#### Parameters
|
|
74
|
+
|
|
75
|
+
| Parameter | Type |
|
|
76
|
+
| ------ | ------ |
|
|
77
|
+
| `containerPort` | `number` |
|
|
78
|
+
|
|
79
|
+
#### Returns
|
|
80
|
+
|
|
81
|
+
`number`
|
|
82
|
+
|
|
83
|
+
***
|
|
84
|
+
|
|
85
|
+
### start
|
|
86
|
+
|
|
87
|
+
```ts
|
|
88
|
+
start: () => Promise<void>;
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Defined in: [src/model/ports/container.port.ts:7](https://github.com/jterrazz/package-test/blob/main/src/model/ports/container.port.ts#L7)
|
|
92
|
+
|
|
93
|
+
Start the container and wait until ready.
|
|
94
|
+
|
|
95
|
+
#### Returns
|
|
96
|
+
|
|
97
|
+
`Promise`\<`void`\>
|
|
98
|
+
|
|
99
|
+
***
|
|
100
|
+
|
|
101
|
+
### stop
|
|
102
|
+
|
|
103
|
+
```ts
|
|
104
|
+
stop: () => Promise<void>;
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Defined in: [src/model/ports/container.port.ts:10](https://github.com/jterrazz/package-test/blob/main/src/model/ports/container.port.ts#L10)
|
|
108
|
+
|
|
109
|
+
Stop and remove the container.
|
|
110
|
+
|
|
111
|
+
#### Returns
|
|
112
|
+
|
|
113
|
+
`Promise`\<`void`\>
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
<!-- GENERATED by `typescript docs` — DO NOT EDIT -->
|
|
2
|
+
# Type Alias: Contract
|
|
3
|
+
|
|
4
|
+
```ts
|
|
5
|
+
type Contract = object;
|
|
6
|
+
```
|
|
7
|
+
|
|
8
|
+
Defined in: [src/model/contracts/contract.ts:10](https://github.com/jterrazz/package-test/blob/main/src/model/contracts/contract.ts#L10)
|
|
9
|
+
|
|
10
|
+
A declared external interaction: what to match (`request`) and what to reply
|
|
11
|
+
(`response`), together in one named artifact. Contracts live in TypeScript
|
|
12
|
+
files under `contracts/` next to the tests that use them, so the business
|
|
13
|
+
payload (prompts, JSON responses) is visible at a glance while the real HTTP
|
|
14
|
+
call stays mocked underneath.
|
|
15
|
+
|
|
16
|
+
## Properties
|
|
17
|
+
|
|
18
|
+
### request
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
request: ContractRequest;
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Defined in: [src/model/contracts/contract.ts:12](https://github.com/jterrazz/package-test/blob/main/src/model/contracts/contract.ts#L12)
|
|
25
|
+
|
|
26
|
+
Which outgoing call this contract speaks for.
|
|
27
|
+
|
|
28
|
+
***
|
|
29
|
+
|
|
30
|
+
### required?
|
|
31
|
+
|
|
32
|
+
```ts
|
|
33
|
+
optional required?: boolean;
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Defined in: [src/model/contracts/contract.ts:30](https://github.com/jterrazz/package-test/blob/main/src/model/contracts/contract.ts#L30)
|
|
37
|
+
|
|
38
|
+
When true, the chain FAILS unless the contract was actually requested:
|
|
39
|
+
at least once, or exactly `times` times when `times` is set. Turns a
|
|
40
|
+
silently-unused declaration into a spec failure.
|
|
41
|
+
|
|
42
|
+
***
|
|
43
|
+
|
|
44
|
+
### response
|
|
45
|
+
|
|
46
|
+
```ts
|
|
47
|
+
response: ContractResponseValue;
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Defined in: [src/model/contracts/contract.ts:18](https://github.com/jterrazz/package-test/blob/main/src/model/contracts/contract.ts#L18)
|
|
51
|
+
|
|
52
|
+
The reply — a fixed [ContractResponse](ContractResponse.md), or a function
|
|
53
|
+
`(request) => ContractResponse` evaluated per served request when the
|
|
54
|
+
response must derive from the incoming payload.
|
|
55
|
+
|
|
56
|
+
***
|
|
57
|
+
|
|
58
|
+
### times?
|
|
59
|
+
|
|
60
|
+
```ts
|
|
61
|
+
optional times?: number;
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Defined in: [src/model/contracts/contract.ts:24](https://github.com/jterrazz/package-test/blob/main/src/model/contracts/contract.ts#L24)
|
|
65
|
+
|
|
66
|
+
How many times this contract may serve. Omitted = unlimited (a
|
|
67
|
+
re-render or a retry replays it). `n` = exhausted after n serves, so an
|
|
68
|
+
ordered sequence is a finite contract followed by an unlimited tail.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!-- GENERATED by `typescript docs` — DO NOT EDIT -->
|
|
2
|
+
# Type Alias: ContractInput
|
|
3
|
+
|
|
4
|
+
```ts
|
|
5
|
+
type ContractInput =
|
|
6
|
+
| Contract
|
|
7
|
+
| Contract[]
|
|
8
|
+
| Contracts;
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Defined in: [src/model/contracts/contract.ts:50](https://github.com/jterrazz/package-test/blob/main/src/model/contracts/contract.ts#L50)
|
|
12
|
+
|
|
13
|
+
Any accepted contract input: one, a list, or a composite.
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
<!-- GENERATED by `typescript docs` — DO NOT EDIT -->
|
|
2
|
+
# Type Alias: ContractRequest
|
|
3
|
+
|
|
4
|
+
```ts
|
|
5
|
+
type ContractRequest = object;
|
|
6
|
+
```
|
|
7
|
+
|
|
8
|
+
Defined in: [src/model/contracts/types.ts:26](https://github.com/jterrazz/package-test/blob/main/src/model/contracts/types.ts#L26)
|
|
9
|
+
|
|
10
|
+
The request half of a contract: which outgoing call it speaks for.
|
|
11
|
+
|
|
12
|
+
`url` is either an absolute URL (string or RegExp), or a PATH FORM starting
|
|
13
|
+
with `/` (`/articles/{{uuid}}`) which matches any origin — the shape a
|
|
14
|
+
website/mobile app's own backend calls take. `{{token}}` segments compare
|
|
15
|
+
structurally, declared query params are a subset of the observed ones.
|
|
16
|
+
|
|
17
|
+
## Properties
|
|
18
|
+
|
|
19
|
+
### adapter
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
adapter: string;
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Defined in: [src/model/contracts/types.ts:28](https://github.com/jterrazz/package-test/blob/main/src/model/contracts/types.ts#L28)
|
|
26
|
+
|
|
27
|
+
Adapter name — `http` | `openai` | `anthropic`.
|
|
28
|
+
|
|
29
|
+
***
|
|
30
|
+
|
|
31
|
+
### match?
|
|
32
|
+
|
|
33
|
+
```ts
|
|
34
|
+
optional match?: (request) => boolean;
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Defined in: [src/model/contracts/types.ts:34](https://github.com/jterrazz/package-test/blob/main/src/model/contracts/types.ts#L34)
|
|
38
|
+
|
|
39
|
+
Optional request matcher — the contract only fires if this returns true.
|
|
40
|
+
|
|
41
|
+
#### Parameters
|
|
42
|
+
|
|
43
|
+
| Parameter | Type |
|
|
44
|
+
| ------ | ------ |
|
|
45
|
+
| `request` | [`MatchableRequest`](MatchableRequest.md) |
|
|
46
|
+
|
|
47
|
+
#### Returns
|
|
48
|
+
|
|
49
|
+
`boolean`
|
|
50
|
+
|
|
51
|
+
***
|
|
52
|
+
|
|
53
|
+
### method
|
|
54
|
+
|
|
55
|
+
```ts
|
|
56
|
+
method: string;
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Defined in: [src/model/contracts/types.ts:30](https://github.com/jterrazz/package-test/blob/main/src/model/contracts/types.ts#L30)
|
|
60
|
+
|
|
61
|
+
HTTP method to match. `*` matches any method.
|
|
62
|
+
|
|
63
|
+
***
|
|
64
|
+
|
|
65
|
+
### url
|
|
66
|
+
|
|
67
|
+
```ts
|
|
68
|
+
url: RegExp | string;
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Defined in: [src/model/contracts/types.ts:32](https://github.com/jterrazz/package-test/blob/main/src/model/contracts/types.ts#L32)
|
|
72
|
+
|
|
73
|
+
Absolute URL (string | RegExp) or an any-origin path form (`/articles/{{uuid}}`).
|
|
74
|
+
|
|
75
|
+
***
|
|
76
|
+
|
|
77
|
+
### wrap
|
|
78
|
+
|
|
79
|
+
```ts
|
|
80
|
+
wrap: (data) => ContractResponse;
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Defined in: [src/model/contracts/types.ts:36](https://github.com/jterrazz/package-test/blob/main/src/model/contracts/types.ts#L36)
|
|
84
|
+
|
|
85
|
+
Transform raw data into a provider-specific response envelope.
|
|
86
|
+
|
|
87
|
+
#### Parameters
|
|
88
|
+
|
|
89
|
+
| Parameter | Type |
|
|
90
|
+
| ------ | ------ |
|
|
91
|
+
| `data` | `unknown` |
|
|
92
|
+
|
|
93
|
+
#### Returns
|
|
94
|
+
|
|
95
|
+
[`ContractResponse`](ContractResponse.md)
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<!-- GENERATED by `typescript docs` — DO NOT EDIT -->
|
|
2
|
+
# Type Alias: ContractResponder
|
|
3
|
+
|
|
4
|
+
```ts
|
|
5
|
+
type ContractResponder = (request) => ContractResponse;
|
|
6
|
+
```
|
|
7
|
+
|
|
8
|
+
Defined in: [src/model/contracts/types.ts:105](https://github.com/jterrazz/package-test/blob/main/src/model/contracts/types.ts#L105)
|
|
9
|
+
|
|
10
|
+
A dynamic response: computed from the observed request at the moment the
|
|
11
|
+
contract is served, rather than fixed ahead of time. Handed the same
|
|
12
|
+
[MatchableRequest](MatchableRequest.md) the request half matched on, so the reply can echo
|
|
13
|
+
or derive from the body/headers/url.
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
| Parameter | Type |
|
|
18
|
+
| ------ | ------ |
|
|
19
|
+
| `request` | [`MatchableRequest`](MatchableRequest.md) |
|
|
20
|
+
|
|
21
|
+
## Returns
|
|
22
|
+
|
|
23
|
+
[`ContractResponse`](ContractResponse.md)
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
<!-- GENERATED by `typescript docs` — DO NOT EDIT -->
|
|
2
|
+
# Type Alias: ContractResponse
|
|
3
|
+
|
|
4
|
+
```ts
|
|
5
|
+
type ContractResponse = object;
|
|
6
|
+
```
|
|
7
|
+
|
|
8
|
+
Defined in: [src/model/contracts/types.ts:42](https://github.com/jterrazz/package-test/blob/main/src/model/contracts/types.ts#L42)
|
|
9
|
+
|
|
10
|
+
The response half of a contract: what to reply when the request matches.
|
|
11
|
+
|
|
12
|
+
## Properties
|
|
13
|
+
|
|
14
|
+
### body
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
body: unknown;
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Defined in: [src/model/contracts/types.ts:50](https://github.com/jterrazz/package-test/blob/main/src/model/contracts/types.ts#L50)
|
|
21
|
+
|
|
22
|
+
Response body — an object is JSON, a string is text, `null`/`undefined`
|
|
23
|
+
is empty, and a [StreamBody](StreamBody.md) (built by `http.stream()` /
|
|
24
|
+
`http.sse()`) arrives in pieces.
|
|
25
|
+
|
|
26
|
+
***
|
|
27
|
+
|
|
28
|
+
### delay?
|
|
29
|
+
|
|
30
|
+
```ts
|
|
31
|
+
optional delay?: number;
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Defined in: [src/model/contracts/types.ts:54](https://github.com/jterrazz/package-test/blob/main/src/model/contracts/types.ts#L54)
|
|
35
|
+
|
|
36
|
+
Delay in ms before responding (for timeout testing).
|
|
37
|
+
|
|
38
|
+
***
|
|
39
|
+
|
|
40
|
+
### headers?
|
|
41
|
+
|
|
42
|
+
```ts
|
|
43
|
+
optional headers?: Record<string, string>;
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Defined in: [src/model/contracts/types.ts:52](https://github.com/jterrazz/package-test/blob/main/src/model/contracts/types.ts#L52)
|
|
47
|
+
|
|
48
|
+
Response headers.
|
|
49
|
+
|
|
50
|
+
***
|
|
51
|
+
|
|
52
|
+
### status?
|
|
53
|
+
|
|
54
|
+
```ts
|
|
55
|
+
optional status?: number;
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Defined in: [src/model/contracts/types.ts:44](https://github.com/jterrazz/package-test/blob/main/src/model/contracts/types.ts#L44)
|
|
59
|
+
|
|
60
|
+
HTTP status code (default: 200).
|
|
61
|
+
|
|
62
|
+
***
|
|
63
|
+
|
|
64
|
+
### transport?
|
|
65
|
+
|
|
66
|
+
```ts
|
|
67
|
+
optional transport?: "network-error";
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Defined in: [src/model/contracts/types.ts:64](https://github.com/jterrazz/package-test/blob/main/src/model/contracts/types.ts#L64)
|
|
71
|
+
|
|
72
|
+
A transport failure instead of a reply: the request never reached a
|
|
73
|
+
server, so `fetch` rejects. `status`, `body` and `headers` say nothing
|
|
74
|
+
here — there is no response to carry them.
|
|
75
|
+
|
|
76
|
+
The one thing a status code cannot express. A component's "the server did
|
|
77
|
+
not answer, check that it is running" branch is reached by a rejected
|
|
78
|
+
`fetch`, and a 503 stand-in tests the other branch entirely.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!-- GENERATED by `typescript docs` — DO NOT EDIT -->
|
|
2
|
+
# Type Alias: ContractResponseValue
|
|
3
|
+
|
|
4
|
+
```ts
|
|
5
|
+
type ContractResponseValue =
|
|
6
|
+
| ContractResponder
|
|
7
|
+
| ContractResponse;
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
Defined in: [src/model/contracts/types.ts:111](https://github.com/jterrazz/package-test/blob/main/src/model/contracts/types.ts#L111)
|
|
11
|
+
|
|
12
|
+
What a contract replies with: either a fixed [ContractResponse](ContractResponse.md) or a
|
|
13
|
+
[ContractResponder](ContractResponder.md) evaluated per served request.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
<!-- GENERATED by `typescript docs` — DO NOT EDIT -->
|
|
2
|
+
# Type Alias: Contracts
|
|
3
|
+
|
|
4
|
+
```ts
|
|
5
|
+
type Contracts = object;
|
|
6
|
+
```
|
|
7
|
+
|
|
8
|
+
Defined in: [src/model/contracts/contract.ts:37](https://github.com/jterrazz/package-test/blob/main/src/model/contracts/contract.ts#L37)
|
|
9
|
+
|
|
10
|
+
A composite of contracts — the unit tests import. Flat, ordered, immutable;
|
|
11
|
+
`.with()` derives a variant without touching the original.
|
|
12
|
+
|
|
13
|
+
## Properties
|
|
14
|
+
|
|
15
|
+
### contracts
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
readonly contracts: readonly Contract[];
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Defined in: [src/model/contracts/contract.ts:39](https://github.com/jterrazz/package-test/blob/main/src/model/contracts/contract.ts#L39)
|
|
22
|
+
|
|
23
|
+
The flattened contracts, in selection order.
|
|
24
|
+
|
|
25
|
+
***
|
|
26
|
+
|
|
27
|
+
### with
|
|
28
|
+
|
|
29
|
+
```ts
|
|
30
|
+
with: (...overrides) => Contracts;
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Defined in: [src/model/contracts/contract.ts:46](https://github.com/jterrazz/package-test/blob/main/src/model/contracts/contract.ts#L46)
|
|
34
|
+
|
|
35
|
+
Derive a new composite: every base contract sharing a route with an
|
|
36
|
+
override is REPLACED, and the overrides are PREPENDED — so a
|
|
37
|
+
more-specific override wins first-match selection over a generic base
|
|
38
|
+
route it does not replace.
|
|
39
|
+
|
|
40
|
+
#### Parameters
|
|
41
|
+
|
|
42
|
+
| Parameter | Type |
|
|
43
|
+
| ------ | ------ |
|
|
44
|
+
| ...`overrides` | ([`Contract`](Contract.md) \| [`Contract`](Contract.md)[] \| `Contracts`)[] |
|
|
45
|
+
|
|
46
|
+
#### Returns
|
|
47
|
+
|
|
48
|
+
`Contracts`
|