@jterrazz/test 15.3.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.
Files changed (222) hide show
  1. package/README.md +120 -427
  2. package/dist/appium.adapter.js +71 -15
  3. package/dist/artifacts.js +25 -1735
  4. package/dist/browser/index.js +304 -233
  5. package/dist/checker.d.ts +1 -1
  6. package/dist/checker.js +1103 -97
  7. package/dist/fixtures.js +110 -0
  8. package/dist/index.d.ts +956 -971
  9. package/dist/index.js +2159 -2281
  10. package/dist/literate.js +1747 -0
  11. package/dist/match.js +625 -84
  12. package/dist/oxlint.cjs +3585 -1480
  13. package/dist/oxlint.d.cts +60 -48
  14. package/dist/oxlint.d.ts +60 -48
  15. package/dist/oxlint.js +3585 -1480
  16. package/dist/playwright.adapter.js +51 -8
  17. package/dist/{intercept.js → server.js} +2 -2
  18. package/dist/stream.js +6 -6
  19. package/dist/{ambiguity.js → substring-warning.js} +106 -7
  20. package/dist/vitest.d.ts +67 -48
  21. package/dist/vitest.js +229 -93
  22. package/docs/01-architecture.md +95 -0
  23. package/docs/02-developing.md +351 -0
  24. package/docs/03-testing.md +495 -0
  25. package/docs/04-operating.md +101 -0
  26. package/docs/05-module-tests.md +152 -0
  27. package/docs/06-integration.md +180 -0
  28. package/docs/07-component.md +246 -0
  29. package/docs/08-website.md +404 -0
  30. package/docs/09-mobile.md +270 -0
  31. package/docs/10-api.md +264 -0
  32. package/docs/11-jobs.md +157 -0
  33. package/docs/12-cli.md +677 -0
  34. package/docs/13-elements.md +242 -0
  35. package/docs/14-assertions.md +314 -0
  36. package/docs/15-tokens.md +253 -0
  37. package/docs/16-contracts.md +438 -0
  38. package/docs/17-services.md +188 -0
  39. package/docs/18-conventions.md +305 -0
  40. package/docs/19-linting.md +510 -0
  41. package/docs/README.md +36 -0
  42. package/docs/decisions/001-v9-conventions-on-three-channels.md +50 -0
  43. package/docs/decisions/002-the-statique-channel-holds-only-what-upstream-does-not.md +49 -0
  44. package/docs/decisions/003-a-rendered-component-is-a-facet-on-vitest-browser-mode.md +84 -0
  45. package/docs/decisions/004-a-module-against-real-services-or-a-golden-is-the-integration-facet.md +81 -0
  46. package/docs/decisions/005-the-doubles-ladder-is-closed.md +86 -0
  47. package/docs/decisions/006-the-catalogue-reaches-a-file-by-its-role.md +245 -0
  48. package/docs/decisions/007-compose-mode-leaves-the-package.md +53 -0
  49. package/docs/decisions/008-vitest-5-node-24-and-the-native-seams-as-optional-peers.md +75 -0
  50. package/docs/decisions/_template.md +22 -0
  51. package/docs/reference/classes/Matcher.md +120 -0
  52. package/docs/reference/classes/ProcessHandle.md +368 -0
  53. package/docs/reference/functions/defineContract.md +39 -0
  54. package/docs/reference/functions/defineContracts.md +36 -0
  55. package/docs/reference/functions/disabled.md +28 -0
  56. package/docs/reference/functions/enabled.md +20 -0
  57. package/docs/reference/functions/focused.md +26 -0
  58. package/docs/reference/functions/mockOf.md +79 -0
  59. package/docs/reference/functions/postgres.md +31 -0
  60. package/docs/reference/functions/process.md +33 -0
  61. package/docs/reference/functions/redis.md +28 -0
  62. package/docs/reference/functions/required.md +41 -0
  63. package/docs/reference/functions/selected.md +26 -0
  64. package/docs/reference/functions/sqlite.md +33 -0
  65. package/docs/reference/functions/testId.md +20 -0
  66. package/docs/reference/functions/text.md +40 -0
  67. package/docs/reference/functions/valued.md +28 -0
  68. package/docs/reference/functions/waitUntil.md +46 -0
  69. package/docs/reference/functions/within.md +29 -0
  70. package/docs/reference/index.md +196 -0
  71. package/docs/reference/interfaces/BaseResult.md +87 -0
  72. package/docs/reference/interfaces/CallResult.md +160 -0
  73. package/docs/reference/interfaces/CaptureScope.md +82 -0
  74. package/docs/reference/interfaces/CliResult.md +253 -0
  75. package/docs/reference/interfaces/ContainerAccessor.md +166 -0
  76. package/docs/reference/interfaces/DirectoryAccessor.md +33 -0
  77. package/docs/reference/interfaces/FetchResult.md +180 -0
  78. package/docs/reference/interfaces/FilesystemAccessor.md +46 -0
  79. package/docs/reference/interfaces/HttpResult.md +126 -0
  80. package/docs/reference/interfaces/JsonAccessor.md +46 -0
  81. package/docs/reference/interfaces/PageResult.md +356 -0
  82. package/docs/reference/interfaces/RenderResult.md +72 -0
  83. package/docs/reference/interfaces/RenderedText.md +110 -0
  84. package/docs/reference/interfaces/ResponseAccessor.md +47 -0
  85. package/docs/reference/interfaces/ScreenResult.md +128 -0
  86. package/docs/reference/interfaces/TableAccessor.md +26 -0
  87. package/docs/reference/interfaces/TextAccessor.md +96 -0
  88. package/docs/reference/type-aliases/ApiHandle.md +68 -0
  89. package/docs/reference/type-aliases/ApiSpecification.md +213 -0
  90. package/docs/reference/type-aliases/ApiSpecificationOptions.md +68 -0
  91. package/docs/reference/type-aliases/BrowserConsoleMessage.md +30 -0
  92. package/docs/reference/type-aliases/BrowserLinkElement.md +50 -0
  93. package/docs/reference/type-aliases/BrowserMetaElement.md +40 -0
  94. package/docs/reference/type-aliases/BrowserOpenOptions.md +87 -0
  95. package/docs/reference/type-aliases/BrowserPage.md +132 -0
  96. package/docs/reference/type-aliases/BrowserPort.md +51 -0
  97. package/docs/reference/type-aliases/CliEnv.md +11 -0
  98. package/docs/reference/type-aliases/CliHandle.md +80 -0
  99. package/docs/reference/type-aliases/CliInput.md +36 -0
  100. package/docs/reference/type-aliases/CliOutput.md +46 -0
  101. package/docs/reference/type-aliases/CliPort.md +58 -0
  102. package/docs/reference/type-aliases/CliSpecification.md +144 -0
  103. package/docs/reference/type-aliases/CliSpecificationOptions.md +134 -0
  104. package/docs/reference/type-aliases/ComponentChain.md +156 -0
  105. package/docs/reference/type-aliases/ComponentScenario.md +20 -0
  106. package/docs/reference/type-aliases/ComponentUi.md +47 -0
  107. package/docs/reference/type-aliases/ComponentVisitor.md +10 -0
  108. package/docs/reference/type-aliases/ContainerPort.md +113 -0
  109. package/docs/reference/type-aliases/Contract.md +68 -0
  110. package/docs/reference/type-aliases/ContractInput.md +13 -0
  111. package/docs/reference/type-aliases/ContractRequest.md +95 -0
  112. package/docs/reference/type-aliases/ContractResponder.md +23 -0
  113. package/docs/reference/type-aliases/ContractResponse.md +78 -0
  114. package/docs/reference/type-aliases/ContractResponseValue.md +13 -0
  115. package/docs/reference/type-aliases/Contracts.md +48 -0
  116. package/docs/reference/type-aliases/DatabaseKeys.md +16 -0
  117. package/docs/reference/type-aliases/DatabasePort.md +72 -0
  118. package/docs/reference/type-aliases/DeviceOpenOptions.md +46 -0
  119. package/docs/reference/type-aliases/DevicePort.md +51 -0
  120. package/docs/reference/type-aliases/DeviceScreen.md +32 -0
  121. package/docs/reference/type-aliases/DeviceTimeouts.md +39 -0
  122. package/docs/reference/type-aliases/DockerSpecConfig.md +43 -0
  123. package/docs/reference/type-aliases/DomMount.md +21 -0
  124. package/docs/reference/type-aliases/ElementKind.md +27 -0
  125. package/docs/reference/type-aliases/ElementMatch.md +74 -0
  126. package/docs/reference/type-aliases/ElementOptions.md +29 -0
  127. package/docs/reference/type-aliases/ElementRef.md +128 -0
  128. package/docs/reference/type-aliases/ExecOptions.md +37 -0
  129. package/docs/reference/type-aliases/FileAccessor.md +54 -0
  130. package/docs/reference/type-aliases/HonoApp.md +31 -0
  131. package/docs/reference/type-aliases/HttpContractFilter.md +49 -0
  132. package/docs/reference/type-aliases/HttpResponseInit.md +46 -0
  133. package/docs/reference/type-aliases/HttpStreamInit.md +58 -0
  134. package/docs/reference/type-aliases/IntegrationHandle.md +46 -0
  135. package/docs/reference/type-aliases/IntegrationSpecification.md +111 -0
  136. package/docs/reference/type-aliases/IntegrationSpecificationOptions.md +42 -0
  137. package/docs/reference/type-aliases/Intercept.md +19 -0
  138. package/docs/reference/type-aliases/InterceptOptions.md +28 -0
  139. package/docs/reference/type-aliases/InterceptScope.md +11 -0
  140. package/docs/reference/type-aliases/IsolationStrategy.md +75 -0
  141. package/docs/reference/type-aliases/JobHandle.md +34 -0
  142. package/docs/reference/type-aliases/JobsHandle.md +57 -0
  143. package/docs/reference/type-aliases/JobsResult.md +16 -0
  144. package/docs/reference/type-aliases/JobsSpecification.md +94 -0
  145. package/docs/reference/type-aliases/JobsSpecificationOptions.md +56 -0
  146. package/docs/reference/type-aliases/LandmarkKind.md +20 -0
  147. package/docs/reference/type-aliases/LiterateRunFlags.md +27 -0
  148. package/docs/reference/type-aliases/LiterateServeRegistration.md +70 -0
  149. package/docs/reference/type-aliases/MatchFixtureOptions.md +27 -0
  150. package/docs/reference/type-aliases/MatchableRequest.md +61 -0
  151. package/docs/reference/type-aliases/MatcherKind.md +34 -0
  152. package/docs/reference/type-aliases/MobileBackendOptions.md +28 -0
  153. package/docs/reference/type-aliases/MobileElementKind.md +14 -0
  154. package/docs/reference/type-aliases/MobileElementMatch.md +60 -0
  155. package/docs/reference/type-aliases/MobileElementRef.md +20 -0
  156. package/docs/reference/type-aliases/MobileHandle.md +65 -0
  157. package/docs/reference/type-aliases/MobileScenario.md +20 -0
  158. package/docs/reference/type-aliases/MobileSpecification.md +51 -0
  159. package/docs/reference/type-aliases/MobileSpecificationOptions.md +126 -0
  160. package/docs/reference/type-aliases/MobileVisitor.md +81 -0
  161. package/docs/reference/type-aliases/MockOfOptions.md +26 -0
  162. package/docs/reference/type-aliases/MockPort.md +10 -0
  163. package/docs/reference/type-aliases/PinnedClock.md +10 -0
  164. package/docs/reference/type-aliases/PostgresOptions.md +32 -0
  165. package/docs/reference/type-aliases/ProcessOptions.md +112 -0
  166. package/docs/reference/type-aliases/RedisOptions.md +20 -0
  167. package/docs/reference/type-aliases/RenderSubject.md +12 -0
  168. package/docs/reference/type-aliases/ScreenNode.md +67 -0
  169. package/docs/reference/type-aliases/ServerPort.md +36 -0
  170. package/docs/reference/type-aliases/ServerResponse.md +46 -0
  171. package/docs/reference/type-aliases/ServerSpec.md +21 -0
  172. package/docs/reference/type-aliases/ServiceHandle.md +216 -0
  173. package/docs/reference/type-aliases/ServiceRecord.md +12 -0
  174. package/docs/reference/type-aliases/SpecDocument.md +84 -0
  175. package/docs/reference/type-aliases/SpecEnvToken.md +21 -0
  176. package/docs/reference/type-aliases/SpecFileAssertion.md +27 -0
  177. package/docs/reference/type-aliases/SpecFixture.md +30 -0
  178. package/docs/reference/type-aliases/SpecKind.md +8 -0
  179. package/docs/reference/type-aliases/SpecRun.md +108 -0
  180. package/docs/reference/type-aliases/SpecServeEntry.md +40 -0
  181. package/docs/reference/type-aliases/SpecStream.md +32 -0
  182. package/docs/reference/type-aliases/SpecificationConfig.md +290 -0
  183. package/docs/reference/type-aliases/SqliteOptions.md +36 -0
  184. package/docs/reference/type-aliases/SseEvent.md +58 -0
  185. package/docs/reference/type-aliases/StreamBody.md +61 -0
  186. package/docs/reference/type-aliases/TextFilter.md +22 -0
  187. package/docs/reference/type-aliases/VisitScenario.md +20 -0
  188. package/docs/reference/type-aliases/Visitor.md +215 -0
  189. package/docs/reference/type-aliases/WaitUntilOptions.md +46 -0
  190. package/docs/reference/type-aliases/WebsiteBackendOptions.md +37 -0
  191. package/docs/reference/type-aliases/WebsiteHandle.md +51 -0
  192. package/docs/reference/type-aliases/WebsiteSpecification.md +118 -0
  193. package/docs/reference/type-aliases/WebsiteSpecificationOptions.md +40 -0
  194. package/docs/reference/variables/anthropic.md +19 -0
  195. package/docs/reference/variables/banner.md +10 -0
  196. package/docs/reference/variables/button.md +10 -0
  197. package/docs/reference/variables/clock.md +16 -0
  198. package/docs/reference/variables/complementary.md +10 -0
  199. package/docs/reference/variables/component.md +10 -0
  200. package/docs/reference/variables/content.md +10 -0
  201. package/docs/reference/variables/contentinfo.md +10 -0
  202. package/docs/reference/variables/dialog.md +10 -0
  203. package/docs/reference/variables/field.md +10 -0
  204. package/docs/reference/variables/form.md +10 -0
  205. package/docs/reference/variables/heading.md +10 -0
  206. package/docs/reference/variables/http.md +40 -0
  207. package/docs/reference/variables/intercept.md +11 -0
  208. package/docs/reference/variables/link.md +10 -0
  209. package/docs/reference/variables/listitem.md +10 -0
  210. package/docs/reference/variables/main.md +10 -0
  211. package/docs/reference/variables/match.md +8 -0
  212. package/docs/reference/variables/navigation.md +10 -0
  213. package/docs/reference/variables/openai.md +21 -0
  214. package/docs/reference/variables/option.md +17 -0
  215. package/docs/reference/variables/region.md +10 -0
  216. package/docs/reference/variables/row.md +10 -0
  217. package/docs/reference/variables/search.md +10 -0
  218. package/docs/reference/variables/specification.md +8 -0
  219. package/docs/reference/variables/status.md +10 -0
  220. package/docs/reference/variables/table.md +10 -0
  221. package/package.json +32 -11
  222. package/dist/spec-document.js +0 -651
@@ -0,0 +1,160 @@
1
+ <!-- GENERATED by `typescript docs` — DO NOT EDIT -->
2
+ # Interface: CallResult\<Returned\>
3
+
4
+ Defined in: [src/facets/integration/integration.result.ts:60](https://github.com/jterrazz/package-test/blob/main/src/facets/integration/integration.result.ts#L60)
5
+
6
+ The result of an in-process call — the integration facet's whole surface.
7
+
8
+ Two readings, never both: `value` is what the call RETURNED, `error` is
9
+ what it THREW. A module that refuses is specified the same way a module
10
+ that answers is, and neither needs a `try`/`catch` in the test — a shape
11
+ that costs a refusal spec three times the size of the happy one, and that
12
+ quietly passes when nothing throws at all.
13
+
14
+ Both are the package's ordinary accessors, so the golden mechanism reaches
15
+ them, and `Returned` is what `.call<T>()` returned — `result.value.value` is
16
+ that type, not `unknown`, so a one-field reading needs no golden file: `toMatch('<name>.json'|'<name>.txt')`, the `{{token}}` grammar,
17
+ `{ frozen }` and `TEST_UPDATE=1` all work here exactly as on an HTTP
18
+ response or a command's stdout.
19
+
20
+ ## Extends
21
+
22
+ - [`BaseResult`](BaseResult.md)
23
+
24
+ ## Type Parameters
25
+
26
+ | Type Parameter | Default type |
27
+ | ------ | ------ |
28
+ | `Returned` | `unknown` |
29
+
30
+ ## Accessors
31
+
32
+ ### error
33
+
34
+ #### Get Signature
35
+
36
+ ```ts
37
+ get error(): TextAccessor;
38
+ ```
39
+
40
+ Defined in: [src/facets/integration/integration.result.ts:78](https://github.com/jterrazz/package-test/blob/main/src/facets/integration/integration.result.ts#L78)
41
+
42
+ What the call THREW, as text — the message of an `Error`, the value
43
+ itself when something else was thrown, and empty when it returned.
44
+
45
+ Empty rather than absent on purpose: `await expect(result.error).toBeEmpty()`
46
+ is how a spec says "and it did not refuse" — awaited, because the
47
+ matcher answers a promise on every subject it takes, and a dropped one
48
+ passes the test while the failure surfaces as an unhandled rejection
49
+ (D2 refuses the bare form).
50
+
51
+ ##### Returns
52
+
53
+ [`TextAccessor`](TextAccessor.md)
54
+
55
+ ***
56
+
57
+ ### value
58
+
59
+ #### Get Signature
60
+
61
+ ```ts
62
+ get value(): CallValue<Returned>;
63
+ ```
64
+
65
+ Defined in: [src/facets/integration/integration.result.ts:96](https://github.com/jterrazz/package-test/blob/main/src/facets/integration/integration.result.ts#L96)
66
+
67
+ What the call RETURNED. A string reads as a stream (`<name>.txt`),
68
+ anything else as JSON (`<name>.json`) — the same two subjects every
69
+ other facet's results are built from, chosen on the value in hand and
70
+ typed by CallValue, which answers for the three ways a type can
71
+ relate to `string`.
72
+
73
+ A call that threw has no value to choose an accessor on, so `value` is
74
+ the JSON reading of `null` whatever the declared type promises: what a
75
+ refusal produced is [CallResult.error](#error), and that is where a spec
76
+ reads it.
77
+
78
+ ##### Returns
79
+
80
+ `CallValue`\<`Returned`\>
81
+
82
+ ## Methods
83
+
84
+ ### directory()
85
+
86
+ ```ts
87
+ directory(path?): DirectoryAccessor;
88
+ ```
89
+
90
+ Defined in: [src/model/result/result.ts:55](https://github.com/jterrazz/package-test/blob/main/src/model/result/result.ts#L55)
91
+
92
+ Access a directory (relative to the working directory) for snapshot assertions.
93
+
94
+ #### Parameters
95
+
96
+ | Parameter | Type | Default value |
97
+ | ------ | ------ | ------ |
98
+ | `path` | `string` | `'.'` |
99
+
100
+ #### Returns
101
+
102
+ [`DirectoryAccessor`](DirectoryAccessor.md)
103
+
104
+ #### Inherited from
105
+
106
+ [`BaseResult`](BaseResult.md).[`directory`](BaseResult.md#directory)
107
+
108
+ ***
109
+
110
+ ### file()
111
+
112
+ ```ts
113
+ file(path): FileAccessor;
114
+ ```
115
+
116
+ Defined in: [src/model/result/result.ts:61](https://github.com/jterrazz/package-test/blob/main/src/model/result/result.ts#L61)
117
+
118
+ Access a single file (relative to the working directory) for content assertions.
119
+
120
+ #### Parameters
121
+
122
+ | Parameter | Type |
123
+ | ------ | ------ |
124
+ | `path` | `string` |
125
+
126
+ #### Returns
127
+
128
+ [`FileAccessor`](../type-aliases/FileAccessor.md)
129
+
130
+ #### Inherited from
131
+
132
+ [`BaseResult`](BaseResult.md).[`file`](BaseResult.md#file)
133
+
134
+ ***
135
+
136
+ ### table()
137
+
138
+ ```ts
139
+ table(tableName, options?): TableAccessor;
140
+ ```
141
+
142
+ Defined in: [src/model/result/result.ts:86](https://github.com/jterrazz/package-test/blob/main/src/model/result/result.ts#L86)
143
+
144
+ Access a database table for row-level assertions via expect() matchers.
145
+
146
+ #### Parameters
147
+
148
+ | Parameter | Type |
149
+ | ------ | ------ |
150
+ | `tableName` | `string` |
151
+ | `options?` | \{ `database?`: `string`; \} |
152
+ | `options.database?` | `string` |
153
+
154
+ #### Returns
155
+
156
+ [`TableAccessor`](TableAccessor.md)
157
+
158
+ #### Inherited from
159
+
160
+ [`BaseResult`](BaseResult.md).[`table`](BaseResult.md#table)
@@ -0,0 +1,82 @@
1
+ <!-- GENERATED by `typescript docs` — DO NOT EDIT -->
2
+ # Interface: CaptureScope
3
+
4
+ Defined in: [src/model/matching/match.ts:221](https://github.com/jterrazz/package-test/blob/main/src/model/matching/match.ts#L221)
5
+
6
+ Named captures recorded by `match.ref()` / `{{type#ref}}` placeholders.
7
+ One scope lives on each spec result — every assertion chained off the same
8
+ result shares it, and a new chain starts fresh.
9
+
10
+ ## Properties
11
+
12
+ ### workdir?
13
+
14
+ ```ts
15
+ optional workdir?: string;
16
+ ```
17
+
18
+ Defined in: [src/model/matching/match.ts:227](https://github.com/jterrazz/package-test/blob/main/src/model/matching/match.ts#L227)
19
+
20
+ The exact working directory of the current spec, when the framework
21
+ knows it (cli mode). Drives the `{{workdir}}` token / `match.workdir()`.
22
+
23
+ ## Methods
24
+
25
+ ### get()
26
+
27
+ ```ts
28
+ get(name): unknown;
29
+ ```
30
+
31
+ Defined in: [src/model/matching/match.ts:233](https://github.com/jterrazz/package-test/blob/main/src/model/matching/match.ts#L233)
32
+
33
+ #### Parameters
34
+
35
+ | Parameter | Type |
36
+ | ------ | ------ |
37
+ | `name` | `string` |
38
+
39
+ #### Returns
40
+
41
+ `unknown`
42
+
43
+ ***
44
+
45
+ ### has()
46
+
47
+ ```ts
48
+ has(name): boolean;
49
+ ```
50
+
51
+ Defined in: [src/model/matching/match.ts:237](https://github.com/jterrazz/package-test/blob/main/src/model/matching/match.ts#L237)
52
+
53
+ #### Parameters
54
+
55
+ | Parameter | Type |
56
+ | ------ | ------ |
57
+ | `name` | `string` |
58
+
59
+ #### Returns
60
+
61
+ `boolean`
62
+
63
+ ***
64
+
65
+ ### set()
66
+
67
+ ```ts
68
+ set(name, value): void;
69
+ ```
70
+
71
+ Defined in: [src/model/matching/match.ts:241](https://github.com/jterrazz/package-test/blob/main/src/model/matching/match.ts#L241)
72
+
73
+ #### Parameters
74
+
75
+ | Parameter | Type |
76
+ | ------ | ------ |
77
+ | `name` | `string` |
78
+ | `value` | `unknown` |
79
+
80
+ #### Returns
81
+
82
+ `void`
@@ -0,0 +1,253 @@
1
+ <!-- GENERATED by `typescript docs` — DO NOT EDIT -->
2
+ # Interface: CliResult
3
+
4
+ Defined in: [src/facets/cli/cli.result.ts:33](https://github.com/jterrazz/package-test/blob/main/src/facets/cli/cli.result.ts#L33)
5
+
6
+ Result from a command action (`.exec()`).
7
+
8
+ When the runner was configured with a `docker` option, the result also
9
+ exposes container accessors and participates in `Symbol.asyncDispose`
10
+ cleanup. The Docker shell-outs are **lazy**: a test that never calls
11
+ `.container(...)` never queries the Docker daemon, so command-only tests
12
+ pay zero Docker cost even when the runner is Docker-aware.
13
+
14
+ Dispose always runs one final label-filtered `docker ps` to catch
15
+ containers that were spawned during `.exec` but never asserted on —
16
+ tests still get leak-free cleanup even if they forget to reach into
17
+ a container.
18
+
19
+ ## Extends
20
+
21
+ - [`BaseResult`](BaseResult.md)
22
+
23
+ ## Accessors
24
+
25
+ ### containerIds
26
+
27
+ #### Get Signature
28
+
29
+ ```ts
30
+ get containerIds(): string[];
31
+ ```
32
+
33
+ Defined in: [src/facets/cli/cli.result.ts:117](https://github.com/jterrazz/package-test/blob/main/src/facets/cli/cli.result.ts#L117)
34
+
35
+ All captured container IDs. Triggers the same lazy query as `container()`.
36
+
37
+ ##### Returns
38
+
39
+ `string`[]
40
+
41
+ ***
42
+
43
+ ### exitCode
44
+
45
+ #### Get Signature
46
+
47
+ ```ts
48
+ get exitCode(): number;
49
+ ```
50
+
51
+ Defined in: [src/facets/cli/cli.result.ts:57](https://github.com/jterrazz/package-test/blob/main/src/facets/cli/cli.result.ts#L57)
52
+
53
+ The process exit code.
54
+
55
+ ##### Returns
56
+
57
+ `number`
58
+
59
+ ***
60
+
61
+ ### filesystem
62
+
63
+ #### Get Signature
64
+
65
+ ```ts
66
+ get filesystem(): FilesystemAccessor;
67
+ ```
68
+
69
+ Defined in: [src/facets/cli/cli.result.ts:88](https://github.com/jterrazz/package-test/blob/main/src/facets/cli/cli.result.ts#L88)
70
+
71
+ Accessor for the temporary working directory the command ran in.
72
+
73
+ ##### Returns
74
+
75
+ [`FilesystemAccessor`](FilesystemAccessor.md)
76
+
77
+ ***
78
+
79
+ ### json
80
+
81
+ #### Get Signature
82
+
83
+ ```ts
84
+ get json(): JsonAccessor;
85
+ ```
86
+
87
+ Defined in: [src/facets/cli/cli.result.ts:78](https://github.com/jterrazz/package-test/blob/main/src/facets/cli/cli.result.ts#L78)
88
+
89
+ Accessor for parsing stdout as JSON and asserting against JSON fixtures.
90
+
91
+ ##### Returns
92
+
93
+ [`JsonAccessor`](JsonAccessor.md)
94
+
95
+ ***
96
+
97
+ ### stderr
98
+
99
+ #### Get Signature
100
+
101
+ ```ts
102
+ get stderr(): TextAccessor;
103
+ ```
104
+
105
+ Defined in: [src/facets/cli/cli.result.ts:70](https://github.com/jterrazz/package-test/blob/main/src/facets/cli/cli.result.ts#L70)
106
+
107
+ Accessor for the captured standard error with file-based assertions.
108
+
109
+ ##### Returns
110
+
111
+ [`TextAccessor`](TextAccessor.md)
112
+
113
+ ***
114
+
115
+ ### stdout
116
+
117
+ #### Get Signature
118
+
119
+ ```ts
120
+ get stdout(): TextAccessor;
121
+ ```
122
+
123
+ Defined in: [src/facets/cli/cli.result.ts:62](https://github.com/jterrazz/package-test/blob/main/src/facets/cli/cli.result.ts#L62)
124
+
125
+ Accessor for the captured standard output with file-based assertions.
126
+
127
+ ##### Returns
128
+
129
+ [`TextAccessor`](TextAccessor.md)
130
+
131
+ ## Methods
132
+
133
+ ### \[asyncDispose\]()
134
+
135
+ ```ts
136
+ asyncDispose: Promise<void>;
137
+ ```
138
+
139
+ Defined in: [src/facets/cli/cli.result.ts:123](https://github.com/jterrazz/package-test/blob/main/src/facets/cli/cli.result.ts#L123)
140
+
141
+ #### Returns
142
+
143
+ `Promise`\<`void`\>
144
+
145
+ ***
146
+
147
+ ### container()
148
+
149
+ ```ts
150
+ container(name): ContainerAccessor;
151
+ ```
152
+
153
+ Defined in: [src/facets/cli/cli.result.ts:106](https://github.com/jterrazz/package-test/blob/main/src/facets/cli/cli.result.ts#L106)
154
+
155
+ Look up a container the command spawned during this run by the value of
156
+ its name-label (as declared in the `docker.nameLabel` of the
157
+ `specification.cli()` options).
158
+ First access triggers a one-shot `docker ps` + `docker inspect`
159
+ query and caches the result for the rest of the result's lifetime.
160
+ Tests that don't call this never touch Docker.
161
+
162
+ Returns an accessor with `.exists === false` when no container
163
+ carries that name — callers can still assert absence without a try.
164
+
165
+ #### Parameters
166
+
167
+ | Parameter | Type |
168
+ | ------ | ------ |
169
+ | `name` | `string` |
170
+
171
+ #### Returns
172
+
173
+ [`ContainerAccessor`](ContainerAccessor.md)
174
+
175
+ ***
176
+
177
+ ### directory()
178
+
179
+ ```ts
180
+ directory(path?): DirectoryAccessor;
181
+ ```
182
+
183
+ Defined in: [src/model/result/result.ts:55](https://github.com/jterrazz/package-test/blob/main/src/model/result/result.ts#L55)
184
+
185
+ Access a directory (relative to the working directory) for snapshot assertions.
186
+
187
+ #### Parameters
188
+
189
+ | Parameter | Type | Default value |
190
+ | ------ | ------ | ------ |
191
+ | `path` | `string` | `'.'` |
192
+
193
+ #### Returns
194
+
195
+ [`DirectoryAccessor`](DirectoryAccessor.md)
196
+
197
+ #### Inherited from
198
+
199
+ [`BaseResult`](BaseResult.md).[`directory`](BaseResult.md#directory)
200
+
201
+ ***
202
+
203
+ ### file()
204
+
205
+ ```ts
206
+ file(path): FileAccessor;
207
+ ```
208
+
209
+ Defined in: [src/model/result/result.ts:61](https://github.com/jterrazz/package-test/blob/main/src/model/result/result.ts#L61)
210
+
211
+ Access a single file (relative to the working directory) for content assertions.
212
+
213
+ #### Parameters
214
+
215
+ | Parameter | Type |
216
+ | ------ | ------ |
217
+ | `path` | `string` |
218
+
219
+ #### Returns
220
+
221
+ [`FileAccessor`](../type-aliases/FileAccessor.md)
222
+
223
+ #### Inherited from
224
+
225
+ [`BaseResult`](BaseResult.md).[`file`](BaseResult.md#file)
226
+
227
+ ***
228
+
229
+ ### table()
230
+
231
+ ```ts
232
+ table(tableName, options?): TableAccessor;
233
+ ```
234
+
235
+ Defined in: [src/model/result/result.ts:86](https://github.com/jterrazz/package-test/blob/main/src/model/result/result.ts#L86)
236
+
237
+ Access a database table for row-level assertions via expect() matchers.
238
+
239
+ #### Parameters
240
+
241
+ | Parameter | Type |
242
+ | ------ | ------ |
243
+ | `tableName` | `string` |
244
+ | `options?` | \{ `database?`: `string`; \} |
245
+ | `options.database?` | `string` |
246
+
247
+ #### Returns
248
+
249
+ [`TableAccessor`](TableAccessor.md)
250
+
251
+ #### Inherited from
252
+
253
+ [`BaseResult`](BaseResult.md).[`table`](BaseResult.md#table)
@@ -0,0 +1,166 @@
1
+ <!-- GENERATED by `typescript docs` — DO NOT EDIT -->
2
+ # Interface: ContainerAccessor
3
+
4
+ Defined in: [src/seams/docker/container-accessor.ts:32](https://github.com/jterrazz/package-test/blob/main/src/seams/docker/container-accessor.ts#L32)
5
+
6
+ Assertion accessor for a single Docker container captured by the docker()
7
+ spec mode. Mirrors the shape of [CliResult](CliResult.md) so tests use the same
8
+ vocabulary (`stdout.toContain`, `file(...).content`, etc.) regardless
9
+ of where output came from.
10
+
11
+ Sync state (`exists`, `running`, `status`) is derived from the `docker
12
+ inspect` payload captured at result-construction time. Logs are fetched
13
+ lazily on first access to `stdout`/`stderr`.
14
+
15
+ ## Properties
16
+
17
+ ### exists
18
+
19
+ ```ts
20
+ readonly exists: boolean;
21
+ ```
22
+
23
+ Defined in: [src/seams/docker/container-accessor.ts:35](https://github.com/jterrazz/package-test/blob/main/src/seams/docker/container-accessor.ts#L35)
24
+
25
+ ***
26
+
27
+ ### running
28
+
29
+ ```ts
30
+ readonly running: boolean;
31
+ ```
32
+
33
+ Defined in: [src/seams/docker/container-accessor.ts:37](https://github.com/jterrazz/package-test/blob/main/src/seams/docker/container-accessor.ts#L37)
34
+
35
+ ***
36
+
37
+ ### status
38
+
39
+ ```ts
40
+ readonly status: string;
41
+ ```
42
+
43
+ Defined in: [src/seams/docker/container-accessor.ts:38](https://github.com/jterrazz/package-test/blob/main/src/seams/docker/container-accessor.ts#L38)
44
+
45
+ ## Accessors
46
+
47
+ ### id
48
+
49
+ #### Get Signature
50
+
51
+ ```ts
52
+ get id(): string | null;
53
+ ```
54
+
55
+ Defined in: [src/seams/docker/container-accessor.ts:48](https://github.com/jterrazz/package-test/blob/main/src/seams/docker/container-accessor.ts#L48)
56
+
57
+ Underlying Docker container ID, or `null` if no container was captured
58
+ for this name. Useful when a follow-up CLI command needs to reference
59
+ the container by id (e.g. `spwn world inspect <id>`). Prefer the other
60
+ accessors for common reads — pulling the raw id is the escape hatch.
61
+
62
+ ##### Returns
63
+
64
+ `string` \| `null`
65
+
66
+ ***
67
+
68
+ ### inspect
69
+
70
+ #### Get Signature
71
+
72
+ ```ts
73
+ get inspect(): JsonAccessor;
74
+ ```
75
+
76
+ Defined in: [src/seams/docker/container-accessor.ts:77](https://github.com/jterrazz/package-test/blob/main/src/seams/docker/container-accessor.ts#L77)
77
+
78
+ Raw `docker inspect` object for this container. Throws if the container
79
+ was not captured (i.e. `.exists === false`).
80
+
81
+ ##### Returns
82
+
83
+ [`JsonAccessor`](JsonAccessor.md)
84
+
85
+ ***
86
+
87
+ ### stderr
88
+
89
+ #### Get Signature
90
+
91
+ ```ts
92
+ get stderr(): TextAccessor;
93
+ ```
94
+
95
+ Defined in: [src/seams/docker/container-accessor.ts:91](https://github.com/jterrazz/package-test/blob/main/src/seams/docker/container-accessor.ts#L91)
96
+
97
+ Captured logs (stdout+stderr combined for v1).
98
+
99
+ ##### Returns
100
+
101
+ [`TextAccessor`](TextAccessor.md)
102
+
103
+ ***
104
+
105
+ ### stdout
106
+
107
+ #### Get Signature
108
+
109
+ ```ts
110
+ get stdout(): TextAccessor;
111
+ ```
112
+
113
+ Defined in: [src/seams/docker/container-accessor.ts:83](https://github.com/jterrazz/package-test/blob/main/src/seams/docker/container-accessor.ts#L83)
114
+
115
+ Captured logs (stdout+stderr combined for v1).
116
+
117
+ ##### Returns
118
+
119
+ [`TextAccessor`](TextAccessor.md)
120
+
121
+ ## Methods
122
+
123
+ ### exec()
124
+
125
+ ```ts
126
+ exec(cmd): Promise<CliResult>;
127
+ ```
128
+
129
+ Defined in: [src/seams/docker/container-accessor.ts:132](https://github.com/jterrazz/package-test/blob/main/src/seams/docker/container-accessor.ts#L132)
130
+
131
+ Run a shell command inside the container and get back the same
132
+ [CliResult](CliResult.md) used for host-side executions.
133
+
134
+ #### Parameters
135
+
136
+ | Parameter | Type |
137
+ | ------ | ------ |
138
+ | `cmd` | `string` |
139
+
140
+ #### Returns
141
+
142
+ `Promise`\<[`CliResult`](CliResult.md)\>
143
+
144
+ ***
145
+
146
+ ### file()
147
+
148
+ ```ts
149
+ file(path): FileAccessor;
150
+ ```
151
+
152
+ Defined in: [src/seams/docker/container-accessor.ts:103](https://github.com/jterrazz/package-test/blob/main/src/seams/docker/container-accessor.ts#L103)
153
+
154
+ Read a file from inside the container via `docker exec cat`. The
155
+ returned object satisfies the same [FileAccessor](../type-aliases/FileAccessor.md) shape used by
156
+ the host filesystem accessor, so tests do not need to learn a new API.
157
+
158
+ #### Parameters
159
+
160
+ | Parameter | Type |
161
+ | ------ | ------ |
162
+ | `path` | `string` |
163
+
164
+ #### Returns
165
+
166
+ [`FileAccessor`](../type-aliases/FileAccessor.md)
@@ -0,0 +1,33 @@
1
+ <!-- GENERATED by `typescript docs` — DO NOT EDIT -->
2
+ # Interface: DirectoryAccessor
3
+
4
+ Defined in: [src/model/result/directory.ts:97](https://github.com/jterrazz/package-test/blob/main/src/model/result/directory.ts#L97)
5
+
6
+ Read-only accessor for a directory produced by a spec action.
7
+
8
+ Assertions go through `expect()` (async — they walk the disk):
9
+ `await expect(result.directory('out')).toMatch('scaffold/out')`
10
+ compares the tree against the fixture directory `_expected/<name>/`.
11
+
12
+ ## Methods
13
+
14
+ ### files()
15
+
16
+ ```ts
17
+ files(options?): Promise<string[]>;
18
+ ```
19
+
20
+ Defined in: [src/model/result/directory.ts:112](https://github.com/jterrazz/package-test/blob/main/src/model/result/directory.ts#L112)
21
+
22
+ List all files (recursively) under the directory, sorted.
23
+
24
+ #### Parameters
25
+
26
+ | Parameter | Type |
27
+ | ------ | ------ |
28
+ | `options` | \{ `ignore?`: `string`[]; \} |
29
+ | `options.ignore?` | `string`[] |
30
+
31
+ #### Returns
32
+
33
+ `Promise`\<`string`[]\>