@jterrazz/test 16.1.0 → 17.0.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 (304) hide show
  1. package/README.md +45 -171
  2. package/dist/browser/index.js +2 -2867
  3. package/dist/browser/services.js +2 -0
  4. package/dist/browser/stubs.js +2 -0
  5. package/dist/checker.d.ts +6 -1
  6. package/dist/checker.js +4551 -2612
  7. package/dist/config.d.ts +40 -0
  8. package/dist/config.js +309 -0
  9. package/dist/in-place.global-setup.d.ts +11 -0
  10. package/dist/in-place.global-setup.js +21 -0
  11. package/dist/index.d.ts +1653 -3002
  12. package/dist/index.js +5226 -3845
  13. package/dist/mobile-session.global-setup.d.ts +14 -0
  14. package/dist/mobile-session.global-setup.js +31 -0
  15. package/dist/oxlint.cjs +6073 -5616
  16. package/dist/oxlint.d.cts +43 -7212
  17. package/dist/oxlint.d.ts +43 -7212
  18. package/dist/oxlint.js +6065 -5609
  19. package/dist/route-coverage.global-setup.d.ts +42 -0
  20. package/dist/route-coverage.global-setup.js +2 -0
  21. package/dist/services.d.ts +3 -0
  22. package/dist/services.global-setup.d.ts +43 -0
  23. package/dist/services.global-setup.js +2 -0
  24. package/dist/services.js +597 -0
  25. package/dist/shared-appium.adapter.js +428 -0
  26. package/dist/shared-artifacts.js +32 -0
  27. package/dist/shared-chapter.js +7 -0
  28. package/dist/shared-container.port.d.ts +31 -0
  29. package/dist/shared-derived-projects.js +58 -0
  30. package/dist/shared-device.port.d.ts +189 -0
  31. package/dist/shared-exchange.js +447 -0
  32. package/dist/shared-in-place.js +172 -0
  33. package/dist/shared-index.browser.js +3191 -0
  34. package/dist/shared-index.services.d.ts +346 -0
  35. package/dist/shared-index.stubs.d.ts +287 -0
  36. package/dist/shared-json-shape.js +17 -0
  37. package/dist/shared-landmarks.js +71 -0
  38. package/dist/shared-ledger.js +68 -0
  39. package/dist/shared-literate-plugin.js +183 -0
  40. package/dist/shared-manifest.js +1321 -0
  41. package/dist/shared-pause.js +11 -0
  42. package/dist/shared-peer.js +88 -0
  43. package/dist/shared-playwright.adapter.js +330 -0
  44. package/dist/shared-process.adapter.js +74 -0
  45. package/dist/shared-refusal.js +35 -0
  46. package/dist/shared-resolve.js +24 -0
  47. package/dist/shared-route-coverage.global-setup.js +187 -0
  48. package/dist/shared-scenario-failure.js +198 -0
  49. package/dist/shared-serve.js +365 -0
  50. package/dist/shared-service-images.js +10 -0
  51. package/dist/shared-services.global-setup.js +179 -0
  52. package/dist/shared-session-ledger.js +301 -0
  53. package/dist/shared-setup-entry.js +12 -0
  54. package/dist/shared-source-scan.js +133 -0
  55. package/dist/shared-spec-document.js +365 -0
  56. package/dist/shared-specifications.js +26 -0
  57. package/dist/shared-stream-body.js +130 -0
  58. package/dist/shared-stub-server.js +190 -0
  59. package/dist/shared-temp-root.global-setup.js +80 -0
  60. package/dist/shared-test-baseline.js +26 -0
  61. package/dist/shared-test-section.js +58 -0
  62. package/dist/shared-testcontainers.adapter.js +203 -0
  63. package/dist/shared-tokens.js +55 -0
  64. package/dist/shared-yaml-document.js +119 -0
  65. package/dist/stubs.d.ts +2 -0
  66. package/dist/stubs.js +657 -0
  67. package/dist/temp-root.global-setup.d.ts +7 -0
  68. package/dist/temp-root.global-setup.js +2 -0
  69. package/dist/vitest.d.ts +97 -163
  70. package/dist/vitest.js +374 -507
  71. package/docs/README.md +82 -36
  72. package/docs/concepts/architecture.md +118 -0
  73. package/docs/concepts/conventions.md +333 -0
  74. package/docs/guides/api-specs.md +374 -0
  75. package/docs/guides/cli-specs.md +564 -0
  76. package/docs/guides/component-specs.md +252 -0
  77. package/docs/guides/develop.md +94 -0
  78. package/docs/guides/integration-specs.md +181 -0
  79. package/docs/guides/job-specs.md +180 -0
  80. package/docs/guides/lint-specs.md +174 -0
  81. package/docs/guides/mobile-specs.md +319 -0
  82. package/docs/guides/module-tests.md +149 -0
  83. package/docs/guides/release.md +43 -0
  84. package/docs/guides/spec-documents.md +189 -0
  85. package/docs/guides/website-specs.md +413 -0
  86. package/docs/reference/assertions.md +345 -0
  87. package/docs/reference/glossary.md +20 -0
  88. package/docs/reference/linting.md +483 -0
  89. package/docs/reference/services.md +236 -0
  90. package/docs/reference/stubs.md +498 -0
  91. package/docs/reference/time-and-doubles.md +137 -0
  92. package/docs/reference/tokens.md +258 -0
  93. package/docs/reference/visitor.md +221 -0
  94. package/docs/start/getting-started.md +187 -0
  95. package/docs/start/set-up-a-project.md +214 -0
  96. package/package.json +50 -30
  97. package/schema/spec.schema.json +43 -17
  98. package/dist/appium.adapter.js +0 -489
  99. package/dist/artifacts.js +0 -32
  100. package/dist/fixtures.js +0 -110
  101. package/dist/literate.js +0 -1747
  102. package/dist/match.js +0 -804
  103. package/dist/playwright.adapter.js +0 -349
  104. package/dist/server.js +0 -160
  105. package/dist/stream.js +0 -321
  106. package/dist/substring-warning.js +0 -244
  107. package/docs/01-architecture.md +0 -95
  108. package/docs/02-developing.md +0 -351
  109. package/docs/03-testing.md +0 -495
  110. package/docs/04-operating.md +0 -101
  111. package/docs/05-module-tests.md +0 -152
  112. package/docs/06-integration.md +0 -180
  113. package/docs/07-component.md +0 -246
  114. package/docs/08-website.md +0 -404
  115. package/docs/09-mobile.md +0 -270
  116. package/docs/10-api.md +0 -264
  117. package/docs/11-jobs.md +0 -157
  118. package/docs/12-cli.md +0 -677
  119. package/docs/13-elements.md +0 -242
  120. package/docs/14-assertions.md +0 -314
  121. package/docs/15-tokens.md +0 -253
  122. package/docs/16-contracts.md +0 -438
  123. package/docs/17-services.md +0 -188
  124. package/docs/18-conventions.md +0 -305
  125. package/docs/19-linting.md +0 -510
  126. package/docs/decisions/001-v9-conventions-on-three-channels.md +0 -50
  127. package/docs/decisions/002-the-statique-channel-holds-only-what-upstream-does-not.md +0 -49
  128. package/docs/decisions/003-a-rendered-component-is-a-facet-on-vitest-browser-mode.md +0 -84
  129. package/docs/decisions/004-a-module-against-real-services-or-a-golden-is-the-integration-facet.md +0 -81
  130. package/docs/decisions/005-the-doubles-ladder-is-closed.md +0 -86
  131. package/docs/decisions/006-the-catalogue-reaches-a-file-by-its-role.md +0 -245
  132. package/docs/decisions/007-compose-mode-leaves-the-package.md +0 -53
  133. package/docs/decisions/008-vitest-5-node-24-and-the-native-seams-as-optional-peers.md +0 -75
  134. package/docs/decisions/_template.md +0 -22
  135. package/docs/reference/classes/Matcher.md +0 -120
  136. package/docs/reference/classes/ProcessHandle.md +0 -368
  137. package/docs/reference/functions/defineContract.md +0 -39
  138. package/docs/reference/functions/defineContracts.md +0 -36
  139. package/docs/reference/functions/disabled.md +0 -28
  140. package/docs/reference/functions/enabled.md +0 -20
  141. package/docs/reference/functions/focused.md +0 -26
  142. package/docs/reference/functions/mockOf.md +0 -79
  143. package/docs/reference/functions/postgres.md +0 -31
  144. package/docs/reference/functions/process.md +0 -33
  145. package/docs/reference/functions/redis.md +0 -28
  146. package/docs/reference/functions/required.md +0 -41
  147. package/docs/reference/functions/selected.md +0 -26
  148. package/docs/reference/functions/sqlite.md +0 -33
  149. package/docs/reference/functions/testId.md +0 -20
  150. package/docs/reference/functions/text.md +0 -40
  151. package/docs/reference/functions/valued.md +0 -28
  152. package/docs/reference/functions/waitUntil.md +0 -46
  153. package/docs/reference/functions/within.md +0 -29
  154. package/docs/reference/index.md +0 -196
  155. package/docs/reference/interfaces/BaseResult.md +0 -87
  156. package/docs/reference/interfaces/CallResult.md +0 -160
  157. package/docs/reference/interfaces/CaptureScope.md +0 -82
  158. package/docs/reference/interfaces/CliResult.md +0 -253
  159. package/docs/reference/interfaces/ContainerAccessor.md +0 -166
  160. package/docs/reference/interfaces/DirectoryAccessor.md +0 -33
  161. package/docs/reference/interfaces/FetchResult.md +0 -180
  162. package/docs/reference/interfaces/FilesystemAccessor.md +0 -46
  163. package/docs/reference/interfaces/HttpResult.md +0 -126
  164. package/docs/reference/interfaces/JsonAccessor.md +0 -46
  165. package/docs/reference/interfaces/PageResult.md +0 -356
  166. package/docs/reference/interfaces/RenderResult.md +0 -72
  167. package/docs/reference/interfaces/RenderedText.md +0 -110
  168. package/docs/reference/interfaces/ResponseAccessor.md +0 -47
  169. package/docs/reference/interfaces/ScreenResult.md +0 -128
  170. package/docs/reference/interfaces/TableAccessor.md +0 -26
  171. package/docs/reference/interfaces/TextAccessor.md +0 -96
  172. package/docs/reference/type-aliases/ApiHandle.md +0 -68
  173. package/docs/reference/type-aliases/ApiSpecification.md +0 -213
  174. package/docs/reference/type-aliases/ApiSpecificationOptions.md +0 -68
  175. package/docs/reference/type-aliases/BrowserConsoleMessage.md +0 -30
  176. package/docs/reference/type-aliases/BrowserLinkElement.md +0 -50
  177. package/docs/reference/type-aliases/BrowserMetaElement.md +0 -40
  178. package/docs/reference/type-aliases/BrowserOpenOptions.md +0 -87
  179. package/docs/reference/type-aliases/BrowserPage.md +0 -132
  180. package/docs/reference/type-aliases/BrowserPort.md +0 -51
  181. package/docs/reference/type-aliases/CliEnv.md +0 -11
  182. package/docs/reference/type-aliases/CliHandle.md +0 -80
  183. package/docs/reference/type-aliases/CliInput.md +0 -36
  184. package/docs/reference/type-aliases/CliOutput.md +0 -46
  185. package/docs/reference/type-aliases/CliPort.md +0 -58
  186. package/docs/reference/type-aliases/CliSpecification.md +0 -144
  187. package/docs/reference/type-aliases/CliSpecificationOptions.md +0 -134
  188. package/docs/reference/type-aliases/ComponentChain.md +0 -156
  189. package/docs/reference/type-aliases/ComponentScenario.md +0 -20
  190. package/docs/reference/type-aliases/ComponentUi.md +0 -47
  191. package/docs/reference/type-aliases/ComponentVisitor.md +0 -10
  192. package/docs/reference/type-aliases/ContainerPort.md +0 -113
  193. package/docs/reference/type-aliases/Contract.md +0 -68
  194. package/docs/reference/type-aliases/ContractInput.md +0 -13
  195. package/docs/reference/type-aliases/ContractRequest.md +0 -95
  196. package/docs/reference/type-aliases/ContractResponder.md +0 -23
  197. package/docs/reference/type-aliases/ContractResponse.md +0 -78
  198. package/docs/reference/type-aliases/ContractResponseValue.md +0 -13
  199. package/docs/reference/type-aliases/Contracts.md +0 -48
  200. package/docs/reference/type-aliases/DatabaseKeys.md +0 -16
  201. package/docs/reference/type-aliases/DatabasePort.md +0 -72
  202. package/docs/reference/type-aliases/DeviceOpenOptions.md +0 -46
  203. package/docs/reference/type-aliases/DevicePort.md +0 -51
  204. package/docs/reference/type-aliases/DeviceScreen.md +0 -32
  205. package/docs/reference/type-aliases/DeviceTimeouts.md +0 -39
  206. package/docs/reference/type-aliases/DockerSpecConfig.md +0 -43
  207. package/docs/reference/type-aliases/DomMount.md +0 -21
  208. package/docs/reference/type-aliases/ElementKind.md +0 -27
  209. package/docs/reference/type-aliases/ElementMatch.md +0 -74
  210. package/docs/reference/type-aliases/ElementOptions.md +0 -29
  211. package/docs/reference/type-aliases/ElementRef.md +0 -128
  212. package/docs/reference/type-aliases/ExecOptions.md +0 -37
  213. package/docs/reference/type-aliases/FileAccessor.md +0 -54
  214. package/docs/reference/type-aliases/HonoApp.md +0 -31
  215. package/docs/reference/type-aliases/HttpContractFilter.md +0 -49
  216. package/docs/reference/type-aliases/HttpResponseInit.md +0 -46
  217. package/docs/reference/type-aliases/HttpStreamInit.md +0 -58
  218. package/docs/reference/type-aliases/IntegrationHandle.md +0 -46
  219. package/docs/reference/type-aliases/IntegrationSpecification.md +0 -111
  220. package/docs/reference/type-aliases/IntegrationSpecificationOptions.md +0 -42
  221. package/docs/reference/type-aliases/Intercept.md +0 -19
  222. package/docs/reference/type-aliases/InterceptOptions.md +0 -28
  223. package/docs/reference/type-aliases/InterceptScope.md +0 -11
  224. package/docs/reference/type-aliases/IsolationStrategy.md +0 -75
  225. package/docs/reference/type-aliases/JobHandle.md +0 -34
  226. package/docs/reference/type-aliases/JobsHandle.md +0 -57
  227. package/docs/reference/type-aliases/JobsResult.md +0 -16
  228. package/docs/reference/type-aliases/JobsSpecification.md +0 -94
  229. package/docs/reference/type-aliases/JobsSpecificationOptions.md +0 -56
  230. package/docs/reference/type-aliases/LandmarkKind.md +0 -20
  231. package/docs/reference/type-aliases/LiterateRunFlags.md +0 -27
  232. package/docs/reference/type-aliases/LiterateServeRegistration.md +0 -70
  233. package/docs/reference/type-aliases/MatchFixtureOptions.md +0 -27
  234. package/docs/reference/type-aliases/MatchableRequest.md +0 -61
  235. package/docs/reference/type-aliases/MatcherKind.md +0 -34
  236. package/docs/reference/type-aliases/MobileBackendOptions.md +0 -28
  237. package/docs/reference/type-aliases/MobileElementKind.md +0 -14
  238. package/docs/reference/type-aliases/MobileElementMatch.md +0 -60
  239. package/docs/reference/type-aliases/MobileElementRef.md +0 -20
  240. package/docs/reference/type-aliases/MobileHandle.md +0 -65
  241. package/docs/reference/type-aliases/MobileScenario.md +0 -20
  242. package/docs/reference/type-aliases/MobileSpecification.md +0 -51
  243. package/docs/reference/type-aliases/MobileSpecificationOptions.md +0 -126
  244. package/docs/reference/type-aliases/MobileVisitor.md +0 -81
  245. package/docs/reference/type-aliases/MockOfOptions.md +0 -26
  246. package/docs/reference/type-aliases/MockPort.md +0 -10
  247. package/docs/reference/type-aliases/PinnedClock.md +0 -10
  248. package/docs/reference/type-aliases/PostgresOptions.md +0 -32
  249. package/docs/reference/type-aliases/ProcessOptions.md +0 -112
  250. package/docs/reference/type-aliases/RedisOptions.md +0 -20
  251. package/docs/reference/type-aliases/RenderSubject.md +0 -12
  252. package/docs/reference/type-aliases/ScreenNode.md +0 -67
  253. package/docs/reference/type-aliases/ServerPort.md +0 -36
  254. package/docs/reference/type-aliases/ServerResponse.md +0 -46
  255. package/docs/reference/type-aliases/ServerSpec.md +0 -21
  256. package/docs/reference/type-aliases/ServiceHandle.md +0 -216
  257. package/docs/reference/type-aliases/ServiceRecord.md +0 -12
  258. package/docs/reference/type-aliases/SpecDocument.md +0 -84
  259. package/docs/reference/type-aliases/SpecEnvToken.md +0 -21
  260. package/docs/reference/type-aliases/SpecFileAssertion.md +0 -27
  261. package/docs/reference/type-aliases/SpecFixture.md +0 -30
  262. package/docs/reference/type-aliases/SpecKind.md +0 -8
  263. package/docs/reference/type-aliases/SpecRun.md +0 -108
  264. package/docs/reference/type-aliases/SpecServeEntry.md +0 -40
  265. package/docs/reference/type-aliases/SpecStream.md +0 -32
  266. package/docs/reference/type-aliases/SpecificationConfig.md +0 -290
  267. package/docs/reference/type-aliases/SqliteOptions.md +0 -36
  268. package/docs/reference/type-aliases/SseEvent.md +0 -58
  269. package/docs/reference/type-aliases/StreamBody.md +0 -61
  270. package/docs/reference/type-aliases/TextFilter.md +0 -22
  271. package/docs/reference/type-aliases/VisitScenario.md +0 -20
  272. package/docs/reference/type-aliases/Visitor.md +0 -215
  273. package/docs/reference/type-aliases/WaitUntilOptions.md +0 -46
  274. package/docs/reference/type-aliases/WebsiteBackendOptions.md +0 -37
  275. package/docs/reference/type-aliases/WebsiteHandle.md +0 -51
  276. package/docs/reference/type-aliases/WebsiteSpecification.md +0 -118
  277. package/docs/reference/type-aliases/WebsiteSpecificationOptions.md +0 -40
  278. package/docs/reference/variables/anthropic.md +0 -19
  279. package/docs/reference/variables/banner.md +0 -10
  280. package/docs/reference/variables/button.md +0 -10
  281. package/docs/reference/variables/clock.md +0 -16
  282. package/docs/reference/variables/complementary.md +0 -10
  283. package/docs/reference/variables/component.md +0 -10
  284. package/docs/reference/variables/content.md +0 -10
  285. package/docs/reference/variables/contentinfo.md +0 -10
  286. package/docs/reference/variables/dialog.md +0 -10
  287. package/docs/reference/variables/field.md +0 -10
  288. package/docs/reference/variables/form.md +0 -10
  289. package/docs/reference/variables/heading.md +0 -10
  290. package/docs/reference/variables/http.md +0 -40
  291. package/docs/reference/variables/intercept.md +0 -11
  292. package/docs/reference/variables/link.md +0 -10
  293. package/docs/reference/variables/listitem.md +0 -10
  294. package/docs/reference/variables/main.md +0 -10
  295. package/docs/reference/variables/match.md +0 -8
  296. package/docs/reference/variables/navigation.md +0 -10
  297. package/docs/reference/variables/openai.md +0 -21
  298. package/docs/reference/variables/option.md +0 -17
  299. package/docs/reference/variables/region.md +0 -10
  300. package/docs/reference/variables/row.md +0 -10
  301. package/docs/reference/variables/search.md +0 -10
  302. package/docs/reference/variables/specification.md +0 -8
  303. package/docs/reference/variables/status.md +0 -10
  304. package/docs/reference/variables/table.md +0 -10
package/dist/vitest.d.ts CHANGED
@@ -1,36 +1,39 @@
1
+ import { a as MobileDevice } from "./shared-device.port.js";
1
2
  import { TestProjectInlineConfiguration, ViteUserConfig } from "vitest/config";
2
3
  import { UserConfig, UserConfigFn } from "vite";
3
- //#region src/runner/literate-plugin.d.ts
4
+ //#region src/vitest/project.d.ts
5
+ /** What every helper accepts on top of its canonical project. */
6
+ type SpecificationProjectOptions = {
7
+ /** Globs to stay out of: added to the preset's on a specification helper, replacing the canonical ones on `unit()` and `component()`. */
8
+ exclude?: string[];
9
+ /** Replace the canonical `include` globs. */
10
+ include?: string[];
11
+ /** Run files one at a time, for specifications sharing a served app, a database file or a browser profile. */
12
+ serial?: boolean;
13
+ /** Raise (or lower) the 30s budget for this project alone: each test's, and each hook's, which tears down what the test stood on. */
14
+ timeout?: number;
15
+ };
16
+ /** What a specification whose runner boots its subject in this process accepts on top. */
17
+ type InProcessProjectOptions = SpecificationProjectOptions & {
18
+ /** The `*.specification.ts` module its spec files import their runner from: stated, a worker's files share one module graph and the module runs again before each file, so every file still boots its own subject. */
19
+ runner?: string;
20
+ };
21
+ //#endregion
22
+ //#region src/specifications/cli/documents/literate-plugin.d.ts
4
23
  type LiterateOptions = {
5
- /**
6
- * Globs added to the project's test include. Default: every `.spec.yaml`
7
- * file. Narrow it when a tree holds documents that are INPUTS to other
8
- * specs (a deliberately-wrong golden) rather than scenarios to run.
9
- */
24
+ /** Globs added to the test include; narrow it when a tree holds documents that are inputs to other specs. */
10
25
  include?: string[];
11
- /**
12
- * Path to the `*.specification.ts` whose exported `cli` runs the files —
13
- * relative to the vite root, or absolute.
14
- *
15
- * It is stated, never guessed: a repository may declare several cli
16
- * runners (different binaries, different service records), and there is no
17
- * convention that could pick the right one without silently binding a
18
- * scenario to the wrong command.
19
- */
20
- specification: string;
26
+ /** Path to the `*.specification.ts` whose export named for each document's `kind:` runs it; stated, never guessed. */
27
+ runner: string;
21
28
  };
22
- /**
23
- * The shape vite consumes. Declared structurally rather than imported from
24
- * `vite`, so the package's runner coupling stays the one dependency it already
25
- * has (CONVENTIONS I1) — the object is assignable to vite's `Plugin`.
26
- */
29
+ /** Structural, so the runner coupling stays one dependency (the layer map); assignable to vite's `Plugin`. */
27
30
  type LiteratePlugin = {
28
31
  config: () => {
29
32
  test: {
30
33
  include: string[];
31
34
  };
32
35
  };
33
- /** Vite hands the resolved root here — what a relative `specification` is resolved against. */
36
+ /** Vite hands the resolved root here: what a relative `runner` is resolved against. */
34
37
  configResolved: (resolved: {
35
38
  root: string;
36
39
  }) => void;
@@ -38,170 +41,101 @@ type LiteratePlugin = {
38
41
  load: (id: string) => null | string;
39
42
  name: string;
40
43
  };
41
- declare function literate(options: LiterateOptions): LiteratePlugin;
42
- //#endregion
43
- //#region src/runner/preset.d.ts
44
- /**
45
- * Options are a vite/vitest config plus one key of the framework's own.
46
- * Everything stated here wins over the preset's defaults.
47
- */
48
- type SpecConfig = {
49
- /**
50
- * Turns every matching `<case>.spec.yaml` into a test file bound to the
51
- * named specification — the {@link literate} plugin, added to `plugins`.
52
- *
53
- * Declare it here for a config with no `projects`. With projects, the glob
54
- * has to join the include of the ONE project that collects those documents,
55
- * so the plugin goes in that project's own `plugins` instead.
56
- */
57
- literate?: LiterateOptions;
58
- } & ViteUserConfig;
59
- declare function defineSpecConfig(config?: SpecConfig): ViteUserConfig;
44
+ export declare function literate(options: LiterateOptions): LiteratePlugin;
60
45
  //#endregion
61
- //#region src/runner/facet-project.d.ts
62
- /**
63
- * The node facets' canonical projects.
64
- *
65
- * Each one collects the facet's own tree — `specs/<facet>/**\/*.spec.ts`, the
66
- * suffix that says "the assembled product" — carries the preset's budgets and
67
- * artefact directory, and runs in group 0 — the browser facets follow, so two
68
- * Chromiums never share a slot on a two-vCPU runner. `{ include, exclude,
69
- * timeout, serial }` is what a repository states when its tree, its budget or
70
- * its parallelism differs;
71
- * everything else is the framework's.
72
- */
73
- /** What every helper accepts on top of its canonical project. */
74
- type FacetProjectOptions = {
75
- /**
76
- * Globs this project stays out of. On a facet helper they ADD to the
77
- * preset's (`_fixtures/` and vitest's own), because vite concatenates. On
78
- * `unit()` and `component()`, whose canonical `exclude` exists only to
79
- * guard their canonical `include`, stating one replaces it — so state
80
- * both or neither there.
81
- */
82
- exclude?: string[];
83
- /** Replace the canonical `include` globs. */
84
- include?: string[];
85
- /**
86
- * Run this project's files ONE AT A TIME (`fileParallelism: false`) — for
87
- * the facets whose files share something a second worker would collide
88
- * with: one served app, one database file, one browser profile.
89
- */
90
- serial?: boolean;
91
- /** Raise (or lower) the 30s budget for this project alone. */
92
- timeout?: number;
93
- };
94
- //#endregion
95
- //#region src/facets/api/api.project.d.ts
96
- /** `api()` — the app met through HTTP. */
97
- declare function api(options?: FacetProjectOptions): TestProjectInlineConfiguration;
98
- //#endregion
99
- //#region src/facets/cli/cli.project.d.ts
100
- /** `cli()` — a binary, and the documents that specify it. */
101
- type CliProjectOptions = FacetProjectOptions & {
102
- /**
103
- * The literate door, wired by default: every `specs/cli/**\/*.spec.yaml`
104
- * becomes a test file bound to `specs/cli/cli.specification.ts`. State
105
- * `specification` to name another runner, `include` to narrow the glob, or
106
- * `false` to collect no documents at all.
107
- */
46
+ //#region src/specifications/cli/cli.project.d.ts
47
+ /** The literate door of the specification that reads documents: the cli. */
48
+ type LiterateDoor = {
49
+ /** Every `specs/cli/` `.spec.yaml` becomes a test bound to `specs/cli/cli.specification.ts`; `false` collects none. */
108
50
  literate?: false | Partial<LiterateOptions>;
109
51
  };
110
- /**
111
- * A cli project collects the facet's `.test.ts` files AND its documents: a
112
- * `<case>.spec.yaml` is a test file of its own (docs/07 § the literate door),
113
- * so the plugin's glob has to join the include of the project that collects
114
- * them — which is this one, never the root config.
115
- */
116
- declare function cli(options?: CliProjectOptions): TestProjectInlineConfiguration;
52
+ /** `cli()`: a binary, and the documents that specify it. */
53
+ type CliProjectOptions = LiterateDoor & SpecificationProjectOptions;
54
+ /** A cli project: the specification's `.spec.ts` files and its documents (docs/guides/spec-documents.md); the plugin's glob joins this project's include, never the root config. */
55
+ export declare function cli(options?: CliProjectOptions): TestProjectInlineConfiguration;
56
+ //#endregion
57
+ //#region src/specifications/api/api.project.d.ts
58
+ /** `api()`: the app met through HTTP. */
59
+ type ApiProjectOptions = InProcessProjectOptions;
60
+ export declare function api(options?: ApiProjectOptions): TestProjectInlineConfiguration;
117
61
  //#endregion
118
- //#region src/facets/component/component.project.d.ts
119
- /** `component()` — rendered units, beside the components they cover. */
120
- type ComponentProjectOptions = {
62
+ //#region src/specifications/component/component.project.d.ts
63
+ type ComponentOptions = {
121
64
  /** Freeze the page's `Date` for every render of the project. */
122
65
  clock?: string;
123
66
  /** `Accept-Language` and `Intl` locale of the page. Default `'en-US'`. */
124
67
  locale?: string;
125
- /**
126
- * The directory `vite` and `wrap` are resolved against. Default: the
127
- * directory of the file that CALLED the helper — see
128
- * {@link callerDirectory}. State it when the call is not written in the
129
- * config it configures (a shared config factory).
130
- */
68
+ /** The directory `vite` and `wrap` resolve against; defaults to the calling file's. */
131
69
  root?: string;
132
70
  /** IANA zone the page's `Date` reports in. Default `'UTC'`. */
133
71
  timezone?: string;
134
- /**
135
- * The app's own Vite pipeline: a config path, the object, or the function
136
- * a framework exports. Only the PIPELINE is adopted (see {@link reroot}).
137
- */
72
+ /** The app's Vite pipeline: a config path, the object, or a framework's function. Only the pipeline is adopted. */
138
73
  vite?: Promise<UserConfig> | string | UserConfig | UserConfigFn;
139
74
  /** The page size every render gets. Default 1280×720. */
140
75
  viewport?: {
141
76
  height: number;
142
77
  width: number;
143
78
  };
144
- /**
145
- * A module whose default export is `(ui) => ReactNode` — the providers
146
- * every render of this project is dressed in (a theme, a store, an intl
147
- * provider). A router belongs on the chain instead: it is a test's Given.
148
- */
79
+ /** A module whose default export `(ui) => ReactNode` wraps every render; a router is a test's Given, on the chain. */
149
80
  wrap?: string;
150
- } & FacetProjectOptions;
151
- /**
152
- * A component test renders in a real Chromium — the browser the website facet
153
- * already drives through the same `playwright` peer.
154
- *
155
- * The default `include` reaches the whole project, so the default `exclude`
156
- * keeps it out of `specs/`, where the assembled product is specified. State
157
- * your own `include` and the exclusion is yours to state too.
158
- */
159
- declare function component(options?: ComponentProjectOptions): Promise<TestProjectInlineConfiguration>;
81
+ };
82
+ /** `component()`: rendered units, in the `__tests__/` of the folder of the components they cover; under a specs tree, beside them. */
83
+ type ComponentProjectOptions = ComponentOptions & SpecificationProjectOptions;
84
+ /** A component project: renders in a real Chromium; the default `exclude` keeps it out of `specs/`. */
85
+ export declare function component(options?: ComponentProjectOptions): Promise<TestProjectInlineConfiguration>;
86
+ //#endregion
87
+ //#region src/specifications/integration/integration.project.d.ts
88
+ /** `integration()`: a module against real services, or against a golden. */
89
+ type IntegrationProjectOptions = InProcessProjectOptions;
90
+ export declare function integration(options?: IntegrationProjectOptions): TestProjectInlineConfiguration;
160
91
  //#endregion
161
- //#region src/facets/integration/integration.project.d.ts
162
- /** `integration()` — a module against real services, or against a golden. */
163
- declare function integration(options?: FacetProjectOptions): TestProjectInlineConfiguration;
92
+ //#region src/specifications/job/job.project.d.ts
93
+ /** `job()`: the background jobs, run in this process. */
94
+ type JobProjectOptions = InProcessProjectOptions;
95
+ export declare function job(options?: JobProjectOptions): TestProjectInlineConfiguration;
164
96
  //#endregion
165
- //#region src/facets/jobs/jobs.project.d.ts
166
- /** `jobs()` — what a name triggers in-process. */
167
- declare function jobs(options?: FacetProjectOptions): TestProjectInlineConfiguration;
97
+ //#region src/specifications/lint/lint.project.d.ts
98
+ /** `lint()`: the rules a project ships, run by the real linters over fixture trees. */
99
+ type LintProjectOptions = SpecificationProjectOptions;
100
+ export declare function lint(options?: LintProjectOptions): TestProjectInlineConfiguration;
168
101
  //#endregion
169
- //#region src/facets/mobile/mobile.project.d.ts
170
- /**
171
- * `mobile()` — the app on a simulator. A simulator is the one thing that
172
- * cannot share a machine with itself, so it runs last and alone (group 3).
173
- */
174
- declare function mobile(options?: FacetProjectOptions): TestProjectInlineConfiguration;
102
+ //#region src/specifications/mobile/mobile.project.d.ts
103
+ /** The common options; for a run whose specs spawn no server, the device its one Appium server drives. */
104
+ type MobileProjectOptions = SpecificationProjectOptions & ({
105
+ device: MobileDevice;
106
+ root?: string;
107
+ } | {
108
+ device?: never;
109
+ root?: never;
110
+ });
111
+ /** A simulator cannot share a machine with itself: serial. A global setup holds one driver session for the run. */
112
+ export declare function mobile(options?: MobileProjectOptions): TestProjectInlineConfiguration;
175
113
  //#endregion
176
- //#region src/facets/website/website.project.d.ts
177
- /** `website()` — the assembled product, met through a served page. */
178
- type WebsiteProjectOptions = FacetProjectOptions;
179
- /**
180
- * A website spec meets the assembled product through a served page, in the
181
- * Chromium playwright drives. It opens a browser, so it is scheduled before the
182
- * component project and never beside it: two Chromiums must not share a slot on
183
- * a 2-vCPU runner.
184
- */
185
- declare function website(options?: WebsiteProjectOptions): TestProjectInlineConfiguration;
114
+ //#region src/specifications/website/website.project.d.ts
115
+ /** `website()`: the assembled product, met through a served page. */
116
+ type WebsiteProjectOptions = SpecificationProjectOptions;
117
+ export declare function website(options?: WebsiteProjectOptions): TestProjectInlineConfiguration;
186
118
  //#endregion
187
- //#region src/runner/projects.d.ts
188
- /** `unit()` — module tests, beside the modules they cover (CONVENTIONS I2). */
189
- type UnitProjectOptions = FacetProjectOptions & {
190
- /**
191
- * The trees module tests live in, when they do not live in `src/`. Each
192
- * root becomes `<root>/**\/*.test.ts`; `include` states the globs outright.
193
- */
119
+ //#region src/vitest/unit.project.d.ts
120
+ /** `unit()`: module tests, in the `__tests__/` of the folder of the modules they cover (rule `test-in-its-tests-folder`). */
121
+ type UnitProjectOptions = SpecificationProjectOptions & {
122
+ /** `false` shares one module graph per worker (`isolate: false`); for pure projects only. */
123
+ isolate?: boolean;
124
+ /** The trees module tests live in, each collected whole: none, every `.test.ts` outside `specs/`. */
194
125
  roots?: string[];
195
126
  };
196
- /**
197
- * A module test runs beside the module it covers: no DOM, no browser, no
198
- * pipeline. Its suffix is `.test.ts` and its place is OUTSIDE `specs/`, where
199
- * the assembled product is specified in `.spec.ts` — the two exclusions say
200
- * exactly that. `.test.tsx` is the third exclusion because a rendered thing is
201
- * a component test: a project's dependency scan reads every file its globs
202
- * match, and a `.tsx` collected here would be optimised for a page that never
203
- * opens.
204
- */
205
- declare function unit(options?: UnitProjectOptions): TestProjectInlineConfiguration;
127
+ /** `.test.tsx` is excluded: a rendered thing is a component test, and the dependency scan would optimise it for a page that never opens. */
128
+ export declare function unit(options?: UnitProjectOptions): TestProjectInlineConfiguration;
129
+ //#endregion
130
+ //#region src/index.vitest.d.ts
131
+ /** A vite/vitest config, merged over the preset's defaults, plus `literate`. */
132
+ export type SpecConfig = ViteUserConfig & {
133
+ /** Turns matching `<case>.spec.yaml` files into tests; with `projects`, put the plugin in the collecting project instead. */
134
+ literate?: LiterateOptions;
135
+ };
136
+ /** The shared vitest config: what you pass is merged over the defaults. */
137
+ export declare function defineSpecConfig(config?: SpecConfig): ViteUserConfig;
138
+ export declare const vitestConfig: (configUrl: string) => Promise<ViteUserConfig>;
206
139
  //#endregion
207
- export { type CliProjectOptions, type ComponentProjectOptions, type FacetProjectOptions, type LiterateOptions, type LiteratePlugin, type SpecConfig, type UnitProjectOptions, type WebsiteProjectOptions, api, cli, component, defineSpecConfig, integration, jobs, literate, mobile, unit, website };
140
+ export type { ApiProjectOptions, CliProjectOptions, ComponentProjectOptions, InProcessProjectOptions, IntegrationProjectOptions, JobProjectOptions, LintProjectOptions, LiterateDoor, LiterateOptions, LiteratePlugin, MobileProjectOptions, SpecificationProjectOptions, UnitProjectOptions, WebsiteProjectOptions };
141
+ //# sourceMappingURL=vitest.d.ts.map