@ddd-ts-kit/testing 0.0.0-stage → 0.1.1

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 (546) hide show
  1. package/README.md +549 -2
  2. package/dist/builders/buildable.d.ts +7 -0
  3. package/dist/builders/buildable.d.ts.map +1 -0
  4. package/dist/builders/buildable.js +2 -0
  5. package/dist/builders/buildable.js.map +1 -0
  6. package/dist/builders/builder.d.ts +33 -0
  7. package/dist/builders/builder.d.ts.map +1 -0
  8. package/dist/builders/builder.js +66 -0
  9. package/dist/builders/builder.js.map +1 -0
  10. package/dist/builders/defaults.d.ts +6 -0
  11. package/dist/builders/defaults.d.ts.map +1 -0
  12. package/dist/builders/defaults.js +2 -0
  13. package/dist/builders/defaults.js.map +1 -0
  14. package/dist/builders/define-builder.d.ts +14 -0
  15. package/dist/builders/define-builder.d.ts.map +1 -0
  16. package/dist/builders/define-builder.js +10 -0
  17. package/dist/builders/define-builder.js.map +1 -0
  18. package/dist/builders/generic-builder.d.ts +16 -0
  19. package/dist/builders/generic-builder.d.ts.map +1 -0
  20. package/dist/builders/generic-builder.js +23 -0
  21. package/dist/builders/generic-builder.js.map +1 -0
  22. package/dist/builders/is-resolvable.d.ts +3 -0
  23. package/dist/builders/is-resolvable.d.ts.map +1 -0
  24. package/dist/builders/is-resolvable.js +5 -0
  25. package/dist/builders/is-resolvable.js.map +1 -0
  26. package/dist/builders/lazy.d.ts +4 -0
  27. package/dist/builders/lazy.d.ts.map +1 -0
  28. package/dist/builders/lazy.js +15 -0
  29. package/dist/builders/lazy.js.map +1 -0
  30. package/dist/builders/resolvable.d.ts +6 -0
  31. package/dist/builders/resolvable.d.ts.map +1 -0
  32. package/dist/builders/resolvable.js +2 -0
  33. package/dist/builders/resolvable.js.map +1 -0
  34. package/dist/builders/resolve.d.ts +4 -0
  35. package/dist/builders/resolve.d.ts.map +1 -0
  36. package/dist/builders/resolve.js +7 -0
  37. package/dist/builders/resolve.js.map +1 -0
  38. package/dist/builders/sequence.d.ts +10 -0
  39. package/dist/builders/sequence.d.ts.map +1 -0
  40. package/dist/builders/sequence.js +14 -0
  41. package/dist/builders/sequence.js.map +1 -0
  42. package/dist/contracts/awaitable.d.ts +2 -0
  43. package/dist/contracts/awaitable.d.ts.map +1 -0
  44. package/dist/contracts/awaitable.js +2 -0
  45. package/dist/contracts/awaitable.js.map +1 -0
  46. package/dist/contracts/cache-contract.d.ts +13 -0
  47. package/dist/contracts/cache-contract.d.ts.map +1 -0
  48. package/dist/contracts/cache-contract.js +81 -0
  49. package/dist/contracts/cache-contract.js.map +1 -0
  50. package/dist/contracts/contract-runner.d.ts +16 -0
  51. package/dist/contracts/contract-runner.d.ts.map +1 -0
  52. package/dist/contracts/contract-runner.js +2 -0
  53. package/dist/contracts/contract-runner.js.map +1 -0
  54. package/dist/contracts/contract-suite.d.ts +23 -0
  55. package/dist/contracts/contract-suite.d.ts.map +1 -0
  56. package/dist/contracts/contract-suite.js +39 -0
  57. package/dist/contracts/contract-suite.js.map +1 -0
  58. package/dist/contracts/criteria/criteria-case.d.ts +11 -0
  59. package/dist/contracts/criteria/criteria-case.d.ts.map +1 -0
  60. package/dist/contracts/criteria/criteria-case.js +2 -0
  61. package/dist/contracts/criteria/criteria-case.js.map +1 -0
  62. package/dist/contracts/criteria/criteria-contract-definition.d.ts +5 -0
  63. package/dist/contracts/criteria/criteria-contract-definition.d.ts.map +1 -0
  64. package/dist/contracts/criteria/criteria-contract-definition.js +20 -0
  65. package/dist/contracts/criteria/criteria-contract-definition.js.map +1 -0
  66. package/dist/contracts/criteria/criteria-contract-row.d.ts +15 -0
  67. package/dist/contracts/criteria/criteria-contract-row.d.ts.map +1 -0
  68. package/dist/contracts/criteria/criteria-contract-row.js +2 -0
  69. package/dist/contracts/criteria/criteria-contract-row.js.map +1 -0
  70. package/dist/contracts/criteria/criteria-contract-rows.d.ts +9 -0
  71. package/dist/contracts/criteria/criteria-contract-rows.d.ts.map +1 -0
  72. package/dist/contracts/criteria/criteria-contract-rows.js +55 -0
  73. package/dist/contracts/criteria/criteria-contract-rows.js.map +1 -0
  74. package/dist/contracts/criteria/group-cases.d.ts +4 -0
  75. package/dist/contracts/criteria/group-cases.d.ts.map +1 -0
  76. package/dist/contracts/criteria/group-cases.js +96 -0
  77. package/dist/contracts/criteria/group-cases.js.map +1 -0
  78. package/dist/contracts/criteria/operator-cases.d.ts +4 -0
  79. package/dist/contracts/criteria/operator-cases.d.ts.map +1 -0
  80. package/dist/contracts/criteria/operator-cases.js +122 -0
  81. package/dist/contracts/criteria/operator-cases.js.map +1 -0
  82. package/dist/contracts/criteria/scope-cases.d.ts +4 -0
  83. package/dist/contracts/criteria/scope-cases.d.ts.map +1 -0
  84. package/dist/contracts/criteria/scope-cases.js +73 -0
  85. package/dist/contracts/criteria/scope-cases.js.map +1 -0
  86. package/dist/contracts/criteria/sort-cases.d.ts +4 -0
  87. package/dist/contracts/criteria/sort-cases.d.ts.map +1 -0
  88. package/dist/contracts/criteria/sort-cases.js +54 -0
  89. package/dist/contracts/criteria/sort-cases.js.map +1 -0
  90. package/dist/contracts/criteria-contract.d.ts +20 -0
  91. package/dist/contracts/criteria-contract.d.ts.map +1 -0
  92. package/dist/contracts/criteria-contract.js +94 -0
  93. package/dist/contracts/criteria-contract.js.map +1 -0
  94. package/dist/contracts/event-bus-contract.d.ts +23 -0
  95. package/dist/contracts/event-bus-contract.d.ts.map +1 -0
  96. package/dist/contracts/event-bus-contract.js +122 -0
  97. package/dist/contracts/event-bus-contract.js.map +1 -0
  98. package/dist/contracts/failure-of.d.ts +3 -0
  99. package/dist/contracts/failure-of.d.ts.map +1 -0
  100. package/dist/contracts/failure-of.js +12 -0
  101. package/dist/contracts/failure-of.js.map +1 -0
  102. package/dist/contracts/full-envelope.d.ts +4 -0
  103. package/dist/contracts/full-envelope.d.ts.map +1 -0
  104. package/dist/contracts/full-envelope.js +12 -0
  105. package/dist/contracts/full-envelope.js.map +1 -0
  106. package/dist/contracts/job-scheduler-contract.d.ts +21 -0
  107. package/dist/contracts/job-scheduler-contract.d.ts.map +1 -0
  108. package/dist/contracts/job-scheduler-contract.js +181 -0
  109. package/dist/contracts/job-scheduler-contract.js.map +1 -0
  110. package/dist/contracts/lock-contract.d.ts +13 -0
  111. package/dist/contracts/lock-contract.d.ts.map +1 -0
  112. package/dist/contracts/lock-contract.js +90 -0
  113. package/dist/contracts/lock-contract.js.map +1 -0
  114. package/dist/contracts/logger/create-logger.d.ts +6 -0
  115. package/dist/contracts/logger/create-logger.d.ts.map +1 -0
  116. package/dist/contracts/logger/create-logger.js +2 -0
  117. package/dist/contracts/logger/create-logger.js.map +1 -0
  118. package/dist/contracts/logger/error-outline-of.d.ts +12 -0
  119. package/dist/contracts/logger/error-outline-of.d.ts.map +1 -0
  120. package/dist/contracts/logger/error-outline-of.js +27 -0
  121. package/dist/contracts/logger/error-outline-of.js.map +1 -0
  122. package/dist/contracts/logger/logged-line.d.ts +9 -0
  123. package/dist/contracts/logger/logged-line.d.ts.map +1 -0
  124. package/dist/contracts/logger/logged-line.js +2 -0
  125. package/dist/contracts/logger/logged-line.js.map +1 -0
  126. package/dist/contracts/logger/logger-contract-setup.d.ts +11 -0
  127. package/dist/contracts/logger/logger-contract-setup.d.ts.map +1 -0
  128. package/dist/contracts/logger/logger-contract-setup.js +2 -0
  129. package/dist/contracts/logger/logger-contract-setup.js.map +1 -0
  130. package/dist/contracts/logger/logger-entries-suite.d.ts +19 -0
  131. package/dist/contracts/logger/logger-entries-suite.d.ts.map +1 -0
  132. package/dist/contracts/logger/logger-entries-suite.js +177 -0
  133. package/dist/contracts/logger/logger-entries-suite.js.map +1 -0
  134. package/dist/contracts/logger/logger-shutdown-suite.d.ts +15 -0
  135. package/dist/contracts/logger/logger-shutdown-suite.d.ts.map +1 -0
  136. package/dist/contracts/logger/logger-shutdown-suite.js +98 -0
  137. package/dist/contracts/logger/logger-shutdown-suite.js.map +1 -0
  138. package/dist/contracts/logger/logger-under-contract.d.ts +9 -0
  139. package/dist/contracts/logger/logger-under-contract.d.ts.map +1 -0
  140. package/dist/contracts/logger/logger-under-contract.js +2 -0
  141. package/dist/contracts/logger/logger-under-contract.js.map +1 -0
  142. package/dist/contracts/logger/unreadable-total.d.ts +5 -0
  143. package/dist/contracts/logger/unreadable-total.d.ts.map +1 -0
  144. package/dist/contracts/logger/unreadable-total.js +9 -0
  145. package/dist/contracts/logger/unreadable-total.js.map +1 -0
  146. package/dist/contracts/logger-contract.d.ts +14 -0
  147. package/dist/contracts/logger-contract.d.ts.map +1 -0
  148. package/dist/contracts/logger-contract.js +12 -0
  149. package/dist/contracts/logger-contract.js.map +1 -0
  150. package/dist/contracts/outbox-store-contract.d.ts +36 -0
  151. package/dist/contracts/outbox-store-contract.d.ts.map +1 -0
  152. package/dist/contracts/outbox-store-contract.js +148 -0
  153. package/dist/contracts/outbox-store-contract.js.map +1 -0
  154. package/dist/contracts/processed-event-store-contract.d.ts +11 -0
  155. package/dist/contracts/processed-event-store-contract.d.ts.map +1 -0
  156. package/dist/contracts/processed-event-store-contract.js +40 -0
  157. package/dist/contracts/processed-event-store-contract.js.map +1 -0
  158. package/dist/contracts/rate-limiter-contract.d.ts +13 -0
  159. package/dist/contracts/rate-limiter-contract.d.ts.map +1 -0
  160. package/dist/contracts/rate-limiter-contract.js +86 -0
  161. package/dist/contracts/rate-limiter-contract.js.map +1 -0
  162. package/dist/contracts/read-model/everything.d.ts +5 -0
  163. package/dist/contracts/read-model/everything.d.ts.map +1 -0
  164. package/dist/contracts/read-model/everything.js +3 -0
  165. package/dist/contracts/read-model/everything.js.map +1 -0
  166. package/dist/contracts/read-model/read-model-store-suite.d.ts +14 -0
  167. package/dist/contracts/read-model/read-model-store-suite.d.ts.map +1 -0
  168. package/dist/contracts/read-model/read-model-store-suite.js +23 -0
  169. package/dist/contracts/read-model/read-model-store-suite.js.map +1 -0
  170. package/dist/contracts/read-model/read-model-store-under-contract.d.ts +11 -0
  171. package/dist/contracts/read-model/read-model-store-under-contract.d.ts.map +1 -0
  172. package/dist/contracts/read-model/read-model-store-under-contract.js +2 -0
  173. package/dist/contracts/read-model/read-model-store-under-contract.js.map +1 -0
  174. package/dist/contracts/read-model/rebuild-suite.d.ts +14 -0
  175. package/dist/contracts/read-model/rebuild-suite.d.ts.map +1 -0
  176. package/dist/contracts/read-model/rebuild-suite.js +116 -0
  177. package/dist/contracts/read-model/rebuild-suite.js.map +1 -0
  178. package/dist/contracts/read-model/row-of.d.ts +4 -0
  179. package/dist/contracts/read-model/row-of.d.ts.map +1 -0
  180. package/dist/contracts/read-model/row-of.js +10 -0
  181. package/dist/contracts/read-model/row-of.js.map +1 -0
  182. package/dist/contracts/read-model/rows-suite.d.ts +11 -0
  183. package/dist/contracts/read-model/rows-suite.d.ts.map +1 -0
  184. package/dist/contracts/read-model/rows-suite.js +122 -0
  185. package/dist/contracts/read-model/rows-suite.js.map +1 -0
  186. package/dist/contracts/read-model/source-of-truth.d.ts +17 -0
  187. package/dist/contracts/read-model/source-of-truth.d.ts.map +1 -0
  188. package/dist/contracts/read-model/source-of-truth.js +36 -0
  189. package/dist/contracts/read-model/source-of-truth.js.map +1 -0
  190. package/dist/contracts/read-model/stamped-at.d.ts +4 -0
  191. package/dist/contracts/read-model/stamped-at.d.ts.map +1 -0
  192. package/dist/contracts/read-model/stamped-at.js +5 -0
  193. package/dist/contracts/read-model/stamped-at.js.map +1 -0
  194. package/dist/contracts/read-model-store-contract.d.ts +15 -0
  195. package/dist/contracts/read-model-store-contract.d.ts.map +1 -0
  196. package/dist/contracts/read-model-store-contract.js +13 -0
  197. package/dist/contracts/read-model-store-contract.js.map +1 -0
  198. package/dist/contracts/repository-contract.d.ts +18 -0
  199. package/dist/contracts/repository-contract.d.ts.map +1 -0
  200. package/dist/contracts/repository-contract.js +103 -0
  201. package/dist/contracts/repository-contract.js.map +1 -0
  202. package/dist/contracts/unit-of-work/after-commit-suite.d.ts +12 -0
  203. package/dist/contracts/unit-of-work/after-commit-suite.d.ts.map +1 -0
  204. package/dist/contracts/unit-of-work/after-commit-suite.js +79 -0
  205. package/dist/contracts/unit-of-work/after-commit-suite.js.map +1 -0
  206. package/dist/contracts/unit-of-work/dispatch-suite.d.ts +14 -0
  207. package/dist/contracts/unit-of-work/dispatch-suite.d.ts.map +1 -0
  208. package/dist/contracts/unit-of-work/dispatch-suite.js +171 -0
  209. package/dist/contracts/unit-of-work/dispatch-suite.js.map +1 -0
  210. package/dist/contracts/unit-of-work/failure-suite.d.ts +17 -0
  211. package/dist/contracts/unit-of-work/failure-suite.d.ts.map +1 -0
  212. package/dist/contracts/unit-of-work/failure-suite.js +114 -0
  213. package/dist/contracts/unit-of-work/failure-suite.js.map +1 -0
  214. package/dist/contracts/unit-of-work/parcel.d.ts +11 -0
  215. package/dist/contracts/unit-of-work/parcel.d.ts.map +1 -0
  216. package/dist/contracts/unit-of-work/parcel.js +22 -0
  217. package/dist/contracts/unit-of-work/parcel.js.map +1 -0
  218. package/dist/contracts/unit-of-work/parcels.d.ts +10 -0
  219. package/dist/contracts/unit-of-work/parcels.d.ts.map +1 -0
  220. package/dist/contracts/unit-of-work/parcels.js +14 -0
  221. package/dist/contracts/unit-of-work/parcels.js.map +1 -0
  222. package/dist/contracts/unit-of-work/shipping-bench.d.ts +25 -0
  223. package/dist/contracts/unit-of-work/shipping-bench.d.ts.map +1 -0
  224. package/dist/contracts/unit-of-work/shipping-bench.js +58 -0
  225. package/dist/contracts/unit-of-work/shipping-bench.js.map +1 -0
  226. package/dist/contracts/unit-of-work/unit-of-work-under-contract.d.ts +22 -0
  227. package/dist/contracts/unit-of-work/unit-of-work-under-contract.d.ts.map +1 -0
  228. package/dist/contracts/unit-of-work/unit-of-work-under-contract.js +2 -0
  229. package/dist/contracts/unit-of-work/unit-of-work-under-contract.js.map +1 -0
  230. package/dist/contracts/unit-of-work-contract.d.ts +19 -0
  231. package/dist/contracts/unit-of-work-contract.d.ts.map +1 -0
  232. package/dist/contracts/unit-of-work-contract.js +19 -0
  233. package/dist/contracts/unit-of-work-contract.js.map +1 -0
  234. package/dist/contracts.d.ts +27 -0
  235. package/dist/contracts.d.ts.map +1 -0
  236. package/dist/contracts.js +17 -0
  237. package/dist/contracts.js.map +1 -0
  238. package/dist/coverage/affected-contexts.d.ts +7 -0
  239. package/dist/coverage/affected-contexts.d.ts.map +1 -0
  240. package/dist/coverage/affected-contexts.js +15 -0
  241. package/dist/coverage/affected-contexts.js.map +1 -0
  242. package/dist/coverage/contexts-in.d.ts +3 -0
  243. package/dist/coverage/contexts-in.d.ts.map +1 -0
  244. package/dist/coverage/contexts-in.js +13 -0
  245. package/dist/coverage/contexts-in.js.map +1 -0
  246. package/dist/coverage/coverage-layer.d.ts +4 -0
  247. package/dist/coverage/coverage-layer.d.ts.map +1 -0
  248. package/dist/coverage/coverage-layer.js +2 -0
  249. package/dist/coverage/coverage-layer.js.map +1 -0
  250. package/dist/coverage/coverage-rates.d.ts +8 -0
  251. package/dist/coverage/coverage-rates.d.ts.map +1 -0
  252. package/dist/coverage/coverage-rates.js +2 -0
  253. package/dist/coverage/coverage-rates.js.map +1 -0
  254. package/dist/coverage/governed-coverage.d.ts +23 -0
  255. package/dist/coverage/governed-coverage.d.ts.map +1 -0
  256. package/dist/coverage/governed-coverage.js +27 -0
  257. package/dist/coverage/governed-coverage.js.map +1 -0
  258. package/dist/coverage/governed-jest-coverage.d.ts +18 -0
  259. package/dist/coverage/governed-jest-coverage.d.ts.map +1 -0
  260. package/dist/coverage/governed-jest-coverage.js +23 -0
  261. package/dist/coverage/governed-jest-coverage.js.map +1 -0
  262. package/dist/coverage/governed-settings.d.ts +13 -0
  263. package/dist/coverage/governed-settings.d.ts.map +1 -0
  264. package/dist/coverage/governed-settings.js +49 -0
  265. package/dist/coverage/governed-settings.js.map +1 -0
  266. package/dist/coverage/held-layers.d.ts +17 -0
  267. package/dist/coverage/held-layers.d.ts.map +1 -0
  268. package/dist/coverage/held-layers.js +30 -0
  269. package/dist/coverage/held-layers.js.map +1 -0
  270. package/dist/coverage/measured-files.d.ts +4 -0
  271. package/dist/coverage/measured-files.d.ts.map +1 -0
  272. package/dist/coverage/measured-files.js +7 -0
  273. package/dist/coverage/measured-files.js.map +1 -0
  274. package/dist/coverage/measured-layers.d.ts +8 -0
  275. package/dist/coverage/measured-layers.d.ts.map +1 -0
  276. package/dist/coverage/measured-layers.js +14 -0
  277. package/dist/coverage/measured-layers.js.map +1 -0
  278. package/dist/coverage/reference-coverage.d.ts +33 -0
  279. package/dist/coverage/reference-coverage.d.ts.map +1 -0
  280. package/dist/coverage/reference-coverage.js +13 -0
  281. package/dist/coverage/reference-coverage.js.map +1 -0
  282. package/dist/coverage/unaffected-contexts.d.ts +10 -0
  283. package/dist/coverage/unaffected-contexts.d.ts.map +1 -0
  284. package/dist/coverage/unaffected-contexts.js +23 -0
  285. package/dist/coverage/unaffected-contexts.js.map +1 -0
  286. package/dist/coverage.d.ts +7 -0
  287. package/dist/coverage.d.ts.map +1 -0
  288. package/dist/coverage.js +5 -0
  289. package/dist/coverage.js.map +1 -0
  290. package/dist/e2e/collect-events.d.ts +9 -0
  291. package/dist/e2e/collect-events.d.ts.map +1 -0
  292. package/dist/e2e/collect-events.js +9 -0
  293. package/dist/e2e/collect-events.js.map +1 -0
  294. package/dist/e2e/create-http-client.d.ts +4 -0
  295. package/dist/e2e/create-http-client.d.ts.map +1 -0
  296. package/dist/e2e/create-http-client.js +7 -0
  297. package/dist/e2e/create-http-client.js.map +1 -0
  298. package/dist/e2e/database-reset.d.ts +8 -0
  299. package/dist/e2e/database-reset.d.ts.map +1 -0
  300. package/dist/e2e/database-reset.js +2 -0
  301. package/dist/e2e/database-reset.js.map +1 -0
  302. package/dist/e2e/event-recorder.d.ts +12 -0
  303. package/dist/e2e/event-recorder.d.ts.map +1 -0
  304. package/dist/e2e/event-recorder.js +2 -0
  305. package/dist/e2e/event-recorder.js.map +1 -0
  306. package/dist/e2e/event-type.d.ts +5 -0
  307. package/dist/e2e/event-type.d.ts.map +1 -0
  308. package/dist/e2e/event-type.js +2 -0
  309. package/dist/e2e/event-type.js.map +1 -0
  310. package/dist/e2e/eventually.d.ts +13 -0
  311. package/dist/e2e/eventually.d.ts.map +1 -0
  312. package/dist/e2e/eventually.js +27 -0
  313. package/dist/e2e/eventually.js.map +1 -0
  314. package/dist/e2e/expect-problem.d.ts +13 -0
  315. package/dist/e2e/expect-problem.d.ts.map +1 -0
  316. package/dist/e2e/expect-problem.js +27 -0
  317. package/dist/e2e/expect-problem.js.map +1 -0
  318. package/dist/e2e/expect-status.d.ts +7 -0
  319. package/dist/e2e/expect-status.d.ts.map +1 -0
  320. package/dist/e2e/expect-status.js +18 -0
  321. package/dist/e2e/expect-status.js.map +1 -0
  322. package/dist/e2e/fetch-client.d.ts +18 -0
  323. package/dist/e2e/fetch-client.d.ts.map +1 -0
  324. package/dist/e2e/fetch-client.js +56 -0
  325. package/dist/e2e/fetch-client.js.map +1 -0
  326. package/dist/e2e/http-client.d.ts +17 -0
  327. package/dist/e2e/http-client.d.ts.map +1 -0
  328. package/dist/e2e/http-client.js +2 -0
  329. package/dist/e2e/http-client.js.map +1 -0
  330. package/dist/e2e/http-headers.d.ts +2 -0
  331. package/dist/e2e/http-headers.d.ts.map +1 -0
  332. package/dist/e2e/http-headers.js +2 -0
  333. package/dist/e2e/http-headers.js.map +1 -0
  334. package/dist/e2e/http-response.d.ts +9 -0
  335. package/dist/e2e/http-response.d.ts.map +1 -0
  336. package/dist/e2e/http-response.js +2 -0
  337. package/dist/e2e/http-response.js.map +1 -0
  338. package/dist/e2e/listen-on-random-port.d.ts +13 -0
  339. package/dist/e2e/listen-on-random-port.d.ts.map +1 -0
  340. package/dist/e2e/listen-on-random-port.js +21 -0
  341. package/dist/e2e/listen-on-random-port.js.map +1 -0
  342. package/dist/e2e/lower-cased.d.ts +3 -0
  343. package/dist/e2e/lower-cased.d.ts.map +1 -0
  344. package/dist/e2e/lower-cased.js +6 -0
  345. package/dist/e2e/lower-cased.js.map +1 -0
  346. package/dist/e2e/request-options.d.ts +6 -0
  347. package/dist/e2e/request-options.d.ts.map +1 -0
  348. package/dist/e2e/request-options.js +2 -0
  349. package/dist/e2e/request-options.js.map +1 -0
  350. package/dist/e2e/running-server.d.ts +6 -0
  351. package/dist/e2e/running-server.d.ts.map +1 -0
  352. package/dist/e2e/running-server.js +2 -0
  353. package/dist/e2e/running-server.js.map +1 -0
  354. package/dist/e2e/start-test-server.d.ts +18 -0
  355. package/dist/e2e/start-test-server.d.ts.map +1 -0
  356. package/dist/e2e/start-test-server.js +14 -0
  357. package/dist/e2e/start-test-server.js.map +1 -0
  358. package/dist/e2e/subscribed-recorder.d.ts +17 -0
  359. package/dist/e2e/subscribed-recorder.d.ts.map +1 -0
  360. package/dist/e2e/subscribed-recorder.js +45 -0
  361. package/dist/e2e/subscribed-recorder.js.map +1 -0
  362. package/dist/e2e/without-trailing-slashes.d.ts +3 -0
  363. package/dist/e2e/without-trailing-slashes.d.ts.map +1 -0
  364. package/dist/e2e/without-trailing-slashes.js +9 -0
  365. package/dist/e2e/without-trailing-slashes.js.map +1 -0
  366. package/dist/e2e.d.ts +16 -0
  367. package/dist/e2e.d.ts.map +1 -0
  368. package/dist/e2e.js +8 -0
  369. package/dist/e2e.js.map +1 -0
  370. package/dist/execution/a-session.d.ts +4 -0
  371. package/dist/execution/a-session.d.ts.map +1 -0
  372. package/dist/execution/a-session.js +7 -0
  373. package/dist/execution/a-session.js.map +1 -0
  374. package/dist/execution/a-test-user.d.ts +4 -0
  375. package/dist/execution/a-test-user.d.ts.map +1 -0
  376. package/dist/execution/a-test-user.js +9 -0
  377. package/dist/execution/a-test-user.js.map +1 -0
  378. package/dist/execution/an-execution-context.d.ts +4 -0
  379. package/dist/execution/an-execution-context.d.ts.map +1 -0
  380. package/dist/execution/an-execution-context.js +7 -0
  381. package/dist/execution/an-execution-context.js.map +1 -0
  382. package/dist/execution/execution-context-builder.d.ts +37 -0
  383. package/dist/execution/execution-context-builder.d.ts.map +1 -0
  384. package/dist/execution/execution-context-builder.js +67 -0
  385. package/dist/execution/execution-context-builder.js.map +1 -0
  386. package/dist/execution/scoped.d.ts +8 -0
  387. package/dist/execution/scoped.d.ts.map +1 -0
  388. package/dist/execution/scoped.js +9 -0
  389. package/dist/execution/scoped.js.map +1 -0
  390. package/dist/execution/session-builder.d.ts +37 -0
  391. package/dist/execution/session-builder.d.ts.map +1 -0
  392. package/dist/execution/session-builder.js +71 -0
  393. package/dist/execution/session-builder.js.map +1 -0
  394. package/dist/faker/create-data-generator.d.ts +15 -0
  395. package/dist/faker/create-data-generator.d.ts.map +1 -0
  396. package/dist/faker/create-data-generator.js +24 -0
  397. package/dist/faker/create-data-generator.js.map +1 -0
  398. package/dist/faker/current-data-generator.d.ts +9 -0
  399. package/dist/faker/current-data-generator.d.ts.map +1 -0
  400. package/dist/faker/current-data-generator.js +16 -0
  401. package/dist/faker/current-data-generator.js.map +1 -0
  402. package/dist/faker/data-generator.d.ts +9 -0
  403. package/dist/faker/data-generator.d.ts.map +1 -0
  404. package/dist/faker/data-generator.js +2 -0
  405. package/dist/faker/data-generator.js.map +1 -0
  406. package/dist/faker/generated.d.ts +8 -0
  407. package/dist/faker/generated.d.ts.map +1 -0
  408. package/dist/faker/generated.js +10 -0
  409. package/dist/faker/generated.js.map +1 -0
  410. package/dist/faker/replay-hint.d.ts +2 -0
  411. package/dist/faker/replay-hint.d.ts.map +1 -0
  412. package/dist/faker/replay-hint.js +4 -0
  413. package/dist/faker/replay-hint.js.map +1 -0
  414. package/dist/faker/report-seed-on-failure.d.ts +11 -0
  415. package/dist/faker/report-seed-on-failure.d.ts.map +1 -0
  416. package/dist/faker/report-seed-on-failure.js +12 -0
  417. package/dist/faker/report-seed-on-failure.js.map +1 -0
  418. package/dist/faker.d.ts +7 -0
  419. package/dist/faker.d.ts.map +1 -0
  420. package/dist/faker.js +6 -0
  421. package/dist/faker.js.map +1 -0
  422. package/dist/harness/create-test-buses.d.ts +49 -0
  423. package/dist/harness/create-test-buses.d.ts.map +1 -0
  424. package/dist/harness/create-test-buses.js +35 -0
  425. package/dist/harness/create-test-buses.js.map +1 -0
  426. package/dist/index.d.ts +27 -0
  427. package/dist/index.d.ts.map +1 -0
  428. package/dist/index.js +19 -0
  429. package/dist/index.js.map +1 -0
  430. package/dist/repositories/in-memory-repository.d.ts +30 -0
  431. package/dist/repositories/in-memory-repository.d.ts.map +1 -0
  432. package/dist/repositories/in-memory-repository.js +58 -0
  433. package/dist/repositories/in-memory-repository.js.map +1 -0
  434. package/dist/repositories/snapshot-codec.d.ts +6 -0
  435. package/dist/repositories/snapshot-codec.d.ts.map +1 -0
  436. package/dist/repositories/snapshot-codec.js +2 -0
  437. package/dist/repositories/snapshot-codec.js.map +1 -0
  438. package/dist/repositories/snapshots.d.ts +5 -0
  439. package/dist/repositories/snapshots.d.ts.map +1 -0
  440. package/dist/repositories/snapshots.js +9 -0
  441. package/dist/repositories/snapshots.js.map +1 -0
  442. package/dist/scenarios/act.d.ts +5 -0
  443. package/dist/scenarios/act.d.ts.map +1 -0
  444. package/dist/scenarios/act.js +21 -0
  445. package/dist/scenarios/act.js.map +1 -0
  446. package/dist/scenarios/async-outcome.d.ts +5 -0
  447. package/dist/scenarios/async-outcome.d.ts.map +1 -0
  448. package/dist/scenarios/async-outcome.js +2 -0
  449. package/dist/scenarios/async-outcome.js.map +1 -0
  450. package/dist/scenarios/async-scenario.d.ts +5 -0
  451. package/dist/scenarios/async-scenario.d.ts.map +1 -0
  452. package/dist/scenarios/async-scenario.js +2 -0
  453. package/dist/scenarios/async-scenario.js.map +1 -0
  454. package/dist/scenarios/deferred-outcome.d.ts +18 -0
  455. package/dist/scenarios/deferred-outcome.d.ts.map +1 -0
  456. package/dist/scenarios/deferred-outcome.js +34 -0
  457. package/dist/scenarios/deferred-outcome.js.map +1 -0
  458. package/dist/scenarios/describe-event.d.ts +3 -0
  459. package/dist/scenarios/describe-event.d.ts.map +1 -0
  460. package/dist/scenarios/describe-event.js +6 -0
  461. package/dist/scenarios/describe-event.js.map +1 -0
  462. package/dist/scenarios/error-class.d.ts +2 -0
  463. package/dist/scenarios/error-class.d.ts.map +1 -0
  464. package/dist/scenarios/error-class.js +2 -0
  465. package/dist/scenarios/error-class.js.map +1 -0
  466. package/dist/scenarios/event-matcher.d.ts +11 -0
  467. package/dist/scenarios/event-matcher.d.ts.map +1 -0
  468. package/dist/scenarios/event-matcher.js +2 -0
  469. package/dist/scenarios/event-matcher.js.map +1 -0
  470. package/dist/scenarios/event-mismatches.d.ts +5 -0
  471. package/dist/scenarios/event-mismatches.d.ts.map +1 -0
  472. package/dist/scenarios/event-mismatches.js +33 -0
  473. package/dist/scenarios/event-mismatches.js.map +1 -0
  474. package/dist/scenarios/event-source.d.ts +6 -0
  475. package/dist/scenarios/event-source.d.ts.map +1 -0
  476. package/dist/scenarios/event-source.js +2 -0
  477. package/dist/scenarios/event-source.js.map +1 -0
  478. package/dist/scenarios/given.d.ts +9 -0
  479. package/dist/scenarios/given.d.ts.map +1 -0
  480. package/dist/scenarios/given.js +10 -0
  481. package/dist/scenarios/given.js.map +1 -0
  482. package/dist/scenarios/immediate-outcome.d.ts +18 -0
  483. package/dist/scenarios/immediate-outcome.d.ts.map +1 -0
  484. package/dist/scenarios/immediate-outcome.js +147 -0
  485. package/dist/scenarios/immediate-outcome.js.map +1 -0
  486. package/dist/scenarios/is-promise-like.d.ts +2 -0
  487. package/dist/scenarios/is-promise-like.d.ts.map +1 -0
  488. package/dist/scenarios/is-promise-like.js +4 -0
  489. package/dist/scenarios/is-promise-like.js.map +1 -0
  490. package/dist/scenarios/outcome.d.ts +17 -0
  491. package/dist/scenarios/outcome.d.ts.map +1 -0
  492. package/dist/scenarios/outcome.js +2 -0
  493. package/dist/scenarios/outcome.js.map +1 -0
  494. package/dist/scenarios/recorded.d.ts +10 -0
  495. package/dist/scenarios/recorded.d.ts.map +1 -0
  496. package/dist/scenarios/recorded.js +2 -0
  497. package/dist/scenarios/recorded.js.map +1 -0
  498. package/dist/scenarios/scenario.d.ts +18 -0
  499. package/dist/scenarios/scenario.d.ts.map +1 -0
  500. package/dist/scenarios/scenario.js +17 -0
  501. package/dist/scenarios/scenario.js.map +1 -0
  502. package/dist/scenarios/show.d.ts +3 -0
  503. package/dist/scenarios/show.d.ts.map +1 -0
  504. package/dist/scenarios/show.js +6 -0
  505. package/dist/scenarios/show.js.map +1 -0
  506. package/dist/secrecy/expect-no-secret.d.ts +9 -0
  507. package/dist/secrecy/expect-no-secret.d.ts.map +1 -0
  508. package/dist/secrecy/expect-no-secret.js +55 -0
  509. package/dist/secrecy/expect-no-secret.js.map +1 -0
  510. package/dist/vitest/compiler-script.d.ts +3 -0
  511. package/dist/vitest/compiler-script.d.ts.map +1 -0
  512. package/dist/vitest/compiler-script.js +18 -0
  513. package/dist/vitest/compiler-script.js.map +1 -0
  514. package/dist/vitest/decorator-compiler.d.ts +21 -0
  515. package/dist/vitest/decorator-compiler.d.ts.map +1 -0
  516. package/dist/vitest/decorator-compiler.js +112 -0
  517. package/dist/vitest/decorator-compiler.js.map +1 -0
  518. package/dist/vitest/decorator-coverage.d.ts +27 -0
  519. package/dist/vitest/decorator-coverage.d.ts.map +1 -0
  520. package/dist/vitest/decorator-coverage.js +41 -0
  521. package/dist/vitest/decorator-coverage.js.map +1 -0
  522. package/dist/vitest/decorators.d.ts +41 -0
  523. package/dist/vitest/decorators.d.ts.map +1 -0
  524. package/dist/vitest/decorators.js +49 -0
  525. package/dist/vitest/decorators.js.map +1 -0
  526. package/dist/vitest/is-record.d.ts +2 -0
  527. package/dist/vitest/is-record.d.ts.map +1 -0
  528. package/dist/vitest/is-record.js +4 -0
  529. package/dist/vitest/is-record.js.map +1 -0
  530. package/dist/vitest/project-options.d.ts +3 -0
  531. package/dist/vitest/project-options.d.ts.map +1 -0
  532. package/dist/vitest/project-options.js +2 -0
  533. package/dist/vitest/project-options.js.map +1 -0
  534. package/dist/vitest/single-file-project.d.ts +3 -0
  535. package/dist/vitest/single-file-project.d.ts.map +1 -0
  536. package/dist/vitest/single-file-project.js +26 -0
  537. package/dist/vitest/single-file-project.js.map +1 -0
  538. package/dist/vitest/source-map-of.d.ts +3 -0
  539. package/dist/vitest/source-map-of.d.ts.map +1 -0
  540. package/dist/vitest/source-map-of.js +14 -0
  541. package/dist/vitest/source-map-of.js.map +1 -0
  542. package/dist/vitest.d.ts +3 -0
  543. package/dist/vitest.d.ts.map +1 -0
  544. package/dist/vitest.js +3 -0
  545. package/dist/vitest.js.map +1 -0
  546. package/package.json +62 -4
package/README.md CHANGED
@@ -1,3 +1,550 @@
1
- # Temporary Holding Version
1
+ # @ddd-ts-kit/testing
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Readable tests without mocks: test data builders, given / when / then scenarios for
4
+ aggregates, an in-memory harness for handlers, an end-to-end harness over HTTP and the event
5
+ bus, and contract suites that hold fakes and real adapters to the same behaviour. Business
6
+ logic is tested with no infrastructure at all, and the same builders carry to the tests that
7
+ run the whole application.
8
+
9
+ ```
10
+ npm i -D @ddd-ts-kit/testing
11
+ ```
12
+
13
+ | Entry | Holds | Imports |
14
+ |---|---|---|
15
+ | `@ddd-ts-kit/testing` | builders, scenarios, `createTestBuses`, `InMemoryRepository` | no runner, no library |
16
+ | `@ddd-ts-kit/testing/faker` | generated data for builders | `@faker-js/faker` (optional peer) |
17
+ | `@ddd-ts-kit/testing/e2e` | HTTP client, `eventually`, `collectEvents` | Node only: no HTTP framework, no container |
18
+ | `@ddd-ts-kit/testing/contracts` | contract suites of the kernel ports, `ContractSuite` to write another | the runner you pass |
19
+ | `@ddd-ts-kit/testing/vitest` | `decorators()`, the Vite plugin that lets Vitest run standard decorators | Node only; runs the `tsc` of the project |
20
+
21
+ ## Builders
22
+
23
+ A builder declares valid defaults once; a test states only what matters to the rule it checks.
24
+ Every step returns a new, immutable builder, so a base builder can be shared between tests.
25
+
26
+ For an aggregate, write a class: its methods are named in the ubiquitous language, and
27
+ `construct` goes through the public API, so a test can never start from an invalid state.
28
+
29
+ ```ts
30
+ // contexts/ordering/test/builders/order.builder.ts
31
+ import { Builder, sequence, type Buildable, type Defaults } from '@ddd-ts-kit/testing';
32
+
33
+ interface OrderProps {
34
+ id: string;
35
+ customer: Customer;
36
+ lines: readonly Line[];
37
+ paid: boolean;
38
+ }
39
+
40
+ class OrderBuilder extends Builder<OrderProps, Order> {
41
+ protected defaults(): Defaults<OrderProps> {
42
+ return { id: sequence('order'), customer: aCustomer(), lines: [aLine()], paid: false };
43
+ }
44
+
45
+ protected construct(props: OrderProps): Order {
46
+ const order = Order.place(props.id, props.customer, props.lines);
47
+ if (props.paid) {
48
+ order.pay();
49
+ }
50
+ return order;
51
+ }
52
+
53
+ placedBy(customer: Buildable<Customer>): this {
54
+ return this.with('customer', customer);
55
+ }
56
+
57
+ withLine(line: Buildable<Line>): this {
58
+ return this.adding('lines', line);
59
+ }
60
+
61
+ paid(): this {
62
+ return this.with('paid', true);
63
+ }
64
+ }
65
+
66
+ export const anOrder = (): OrderBuilder => new OrderBuilder();
67
+ ```
68
+
69
+ ```ts
70
+ const order = anOrder().paid().withLine(aLine().with('sku', 'sku-1')).build();
71
+ const orders = anOrder().placedBy(aCustomer().named('Ada')).buildMany(3);
72
+ ```
73
+
74
+ For plain data (payloads, DTOs, simple value objects) the functional form is enough. It gives
75
+ the generic `with(key, value)` and `withMany(partial)`, both checked against the properties:
76
+
77
+ ```ts
78
+ import { defineBuilder, lazy, sequence } from '@ddd-ts-kit/testing';
79
+
80
+ export const aLine = defineBuilder<Line>({
81
+ defaults: { sku: sequence('sku'), quantity: 1 },
82
+ });
83
+
84
+ export const anEmail = defineBuilder<{ value: string }, Email>({
85
+ defaults: { value: sequence('email', (n) => `user${n}@example.com`) },
86
+ build: ({ value }) => Email.create(value),
87
+ });
88
+
89
+ aLine().with('quantity', 3).build(); // { sku: 'sku-1', quantity: 3 }
90
+ ```
91
+
92
+ - A builder is accepted wherever a value is: `.with('customer', aCustomer().named('Ada'))`,
93
+ and inside arrays: `.with('lines', [aLine(), { sku: 'pen', quantity: 2 }])`.
94
+ - `sequence('order')` yields `order-1`, `order-2`... at each build; `lazy(() => new Date())`
95
+ computes a default at each build. A value given with `with` consumes nothing.
96
+ - Call `resetSequences()` in `beforeEach`, so a test does not depend on the ones before it.
97
+ - The class form keeps `with`, `withMany` and `adding` protected on purpose: the public
98
+ surface of an aggregate builder is the language of the domain, not its property names.
99
+
100
+ ## Generated data
101
+
102
+ ```
103
+ npm i -D @faker-js/faker
104
+ ```
105
+
106
+ ```ts
107
+ import { generated } from '@ddd-ts-kit/testing/faker';
108
+
109
+ export const aCustomer = defineBuilder<CustomerProps, Customer>({
110
+ defaults: {
111
+ id: sequence('customer'),
112
+ name: generated((faker) => faker.person.fullName()),
113
+ email: generated((faker) => faker.internet.email().toLowerCase()),
114
+ birthDate: generated((faker) => faker.date.birthdate({ mode: 'age', min: 18, max: 90 })),
115
+ },
116
+ build: (props) => Customer.register(props),
117
+ });
118
+
119
+ aCustomer().build(); // a different, valid customer at each build
120
+ aCustomer().with('email', 'ada@example.com'); // stated: the rule under test depends on it
121
+ ```
122
+
123
+ The defaults are generated yet valid: each generator is constrained to what the domain accepts
124
+ (an adult, a lower-case address), and `build` still goes through `Customer.register`.
125
+
126
+ **The rule: generated data for the fields a test does not care about, explicit values for
127
+ what the rule under test depends on.** A test never asserts a generated value it did not
128
+ state, and never relies on a generated value falling on the right side of a rule.
129
+
130
+ Every `generated` value is drawn from one generator per test file, `dataGenerator()`. Its seed
131
+ comes from `TEST_SEED`, else it is random, and it is always known (`dataGenerator().seed`):
132
+
133
+ ```ts
134
+ // vitest setup file
135
+ import { beforeEach, onTestFailed } from 'vitest';
136
+ import { reportSeedOnFailure } from '@ddd-ts-kit/testing/faker';
137
+
138
+ reportSeedOnFailure({ beforeEach, onTestFailed });
139
+ // under a failed test: Generated data seed: 1837264. Replay this file with TEST_SEED=1837264.
140
+ ```
141
+
142
+ | Call | Does |
143
+ |---|---|
144
+ | `generated((faker) => value)` | a default or a `with` value drawn at each build |
145
+ | `dataGenerator()` | the current generator: `seed`, `faker`, `restart()` |
146
+ | `createDataGenerator({ seed?, locales?, referenceDate? })` | a generator of its own; relative dates are computed from a fixed `referenceDate`, so a seed replays them too |
147
+ | `useDataGenerator(generator)` | makes `generated` draw from it, for instance a fixed seed in one suite |
148
+ | `reportSeedOnFailure(runner, log?)` | prints the seed under each failed test |
149
+
150
+ ## Scenarios
151
+
152
+ ```ts
153
+ import { given, scenario } from '@ddd-ts-kit/testing';
154
+
155
+ it('records the payment of a placed order', () => {
156
+ given(anOrder().withLine(aLine().with('quantity', 2)))
157
+ .when((order) => order.pay())
158
+ .thenEvents([{ name: 'ordering.order.paid', amount: 30 }]);
159
+ });
160
+
161
+ it('refuses to pay an order twice', () => {
162
+ given(anOrder().paid())
163
+ .when((order) => order.pay())
164
+ .thenError(OrderAlreadyPaid, 'ORDER_ALREADY_PAID')
165
+ .thenState((order) => expect(order.status).toBe('paid'));
166
+ });
167
+ ```
168
+
169
+ `given` takes an aggregate or its builder and discards the events of the arrangement
170
+ (`pullEvents()`), so only the events of `when` are asserted. `scenario(() => aggregate)` is
171
+ the same with the arrangement as a function, replayed from a fresh aggregate at each `when`.
172
+
173
+ | Assertion | Passes when |
174
+ |---|---|
175
+ | `thenEvents([...])` | exactly these events, in order; each described by its name, its class, or the properties that matter |
176
+ | `thenEventNames([...])` | exactly these names, in order |
177
+ | `thenNoEvent()` | nothing was recorded |
178
+ | `thenError(ErrorClass, code?)`, `thenError(code)` | the action threw that error |
179
+ | `thenState((aggregate) => ...)` | your own assertions on the aggregate pass |
180
+
181
+ Failures are `AssertionError`s of `node:assert` with the expected and recorded events side by
182
+ side, so they read well under any runner. An error raised by `when` is never swallowed: every
183
+ assertion but `thenError` fails on it. When `when` (or the arrangement) is asynchronous, the
184
+ chain is a promise: `await given(order).when(async (o) => ...).thenEventNames([...])`.
185
+
186
+ ## Handlers
187
+
188
+ ```ts
189
+ import { createTestBuses, InMemoryRepository, snapshots } from '@ddd-ts-kit/testing';
190
+
191
+ // domain/repositories/order.repository.ts: the port is an abstract class
192
+ export abstract class OrderRepository extends Repository<Order> {}
193
+
194
+ // test/fakes/in-memory-order.repository.ts: the fake implements the port, it never extends it
195
+ class InMemoryOrderRepository extends InMemoryRepository<Order> implements OrderRepository {
196
+ constructor() {
197
+ super(snapshots({ toSnapshot: (order) => order.toSnapshot(), fromSnapshot: Order.rehydrate }));
198
+ }
199
+ }
200
+
201
+ it('places an order and announces it', async () => {
202
+ const { commandBus, domainEvents, dispatching, eventBus, clock, ids, publishedEvents } = createTestBuses();
203
+ const orders = dispatching(new InMemoryOrderRepository());
204
+ const publisher = new OrderPlacedPublisher(eventBus, ids);
205
+
206
+ domainEvents.on('ordering.order.placed', (event) => publisher.handle(event));
207
+ commandBus.register(PlaceOrder, new PlaceOrderHandler(orders, ids, clock));
208
+
209
+ const id = await commandBus.execute(new PlaceOrder('sku-1'));
210
+
211
+ expect(orders.count()).toBe(1);
212
+ expect(publishedEvents('ordering.order.placed')).toMatchObject([{ payload: { orderId: id } }]);
213
+ });
214
+ ```
215
+
216
+ The handler only saves: `await this.orders.save(order); return order.id;`. `dispatching(fake)`
217
+ gives the fake what the application gives every repository: once `save` (or any method handed
218
+ the aggregate) resolved, the events the aggregate recorded are handed over to `domainEvents`.
219
+
220
+ A handler spec has the production timing. `commandBus` runs every command in `unitOfWork`
221
+ (an `InMemoryUnitOfWork`), as the bus of the application does: the events of every save wait
222
+ until the command handler has returned, then are dispatched in recording order, and
223
+ `execute` resolves once the handlers of both phases ran. A handler that fails in the
224
+ `before-commit` phase rejects `execute`; nothing is undone, since there is no transaction in
225
+ memory. Called outside a command, `orders.save(order)` dispatches before it resolves.
226
+
227
+ ```ts
228
+ domainEvents.on('ordering.order.placed', (event) => board.refresh(event.aggregateId), { phase: 'after-commit' });
229
+
230
+ await commandBus.execute(new PlaceOrder('sku-1')); // resolves even when the handler above failed
231
+
232
+ expect(domainEvents.afterCommitFailures).toEqual([]); // { error, event } of each failure, the last hundred
233
+ ```
234
+
235
+ With `createTestApplication` of `@ddd-ts-kit/di` there is nothing to call: the fake given for a
236
+ repository port announces to `app.domainEvents` with the same timing, and the declared domain
237
+ event handlers react, each in its phase.
238
+
239
+ `InMemoryRepository` is a fake, not a mock: a working repository over a Map that keeps its own
240
+ copy of what is saved (through `snapshots({ toSnapshot, fromSnapshot })` or `{ clone }`) and
241
+ enforces optimistic concurrency on `version`, raising `ConcurrencyError` (code
242
+ `CONCURRENCY_CONFLICT`). Assert its state with `all()` and `count()`.
243
+
244
+ ### Who is acting
245
+
246
+ `createTestBuses()` also gives `executionScope` and `actorContext`, the two doubles of the
247
+ kernel kept together, for the fakes and adapters that stamp audit columns or scope by tenant.
248
+ The default is the user `test-user`, correlation `test-correlation`, origin `test`.
249
+
250
+ ```ts
251
+ import { aSession, anExecutionContext, createTestBuses, scoped } from '@ddd-ts-kit/testing';
252
+
253
+ const { executionScope } = createTestBuses({ executionContext: anExecutionContext().as(ada).build() });
254
+ const orders = new DrizzleOrderRepository(database, executionScope, clock);
255
+
256
+ await orders.save(order); // stamped by ada, in her tenant
257
+ await scoped(executionScope, anExecutionContext().as(bob).ofTenant('globex'), () => orders.findById(order.id));
258
+ ```
259
+
260
+ | Builder | Default | Says |
261
+ |---|---|---|
262
+ | `aSession()` | a user of its own, opened with a password at the test epoch, never expiring | `of(actor)`, `identifiedBy`, `issuedAt`, `expiringAt`, `authenticatedBy`, `withSecondFactor`, `impersonatedBy`, `inLocale`, `inTimeZone`, `withExtensions` |
263
+ | `anExecutionContext()` | the work of a user of its own, origin `test`, correlation of its own | `as(actor)`, `inSession(session)`, `ofTenant`, `correlatedBy`, `causedBy`, `from(origin)`, `dueBy`, `inLocale`, `withExtensions` |
264
+
265
+ Both are classes on `Builder`, immutable like every builder, and accept a builder wherever an
266
+ actor or a session is expected (`aSession().of(anActor().withRole('accountant'))` with the
267
+ actor builder of `@ddd-ts-kit/auth/testing`). `scoped(scope, context, work)` runs a block in a
268
+ context given as a value or as a builder, with any `ExecutionScope`.
269
+
270
+ ## End to end
271
+
272
+ The whole application, real adapters included, driven from the outside: requests in, responses
273
+ and integration events out. Nothing here knows the HTTP framework or how the application is
274
+ composed; `start` says it.
275
+
276
+ ```ts
277
+ import { createServer } from 'node:http';
278
+ import { collectEvents, expectProblem, expectStatus, listenOnRandomPort, startTestServer } from '@ddd-ts-kit/testing/e2e';
279
+
280
+ const app = composeApplication(); // the composition root of main.ts
281
+ const server = await startTestServer({
282
+ start: () => listenOnRandomPort(createServer(expressApp(app))),
283
+ // Fastify: async () => ({ url: await fastify.listen({ port: 0 }), close: () => fastify.close() })
284
+ headers: { authorization: `Bearer ${testToken}` },
285
+ });
286
+ afterAll(() => server.close());
287
+ ```
288
+
289
+ | Call | Does |
290
+ |---|---|
291
+ | `createHttpClient(baseUrl)` | the client alone, for a server the project starts itself: what the `test/e2e/support/start-application.ts` of a generated project uses, on its own `composeApplication(persistence, options)` |
292
+ | `client.get / post / put / patch / delete` | JSON in, `{ status, headers, body }` out; `body` is parsed when the content type is JSON, text otherwise; a 4xx or 5xx is a response, not an exception |
293
+ | `client.post(path, body, { headers })`, `client.withHeaders(headers)` | headers for one call, or a client for another caller |
294
+ | `expectStatus(response, 201)` | hands the response back, or fails showing the body, where the API says why |
295
+ | `expectProblem(response, { status, code })` | asserts an RFC 9457 `application/problem+json` answer and returns the document |
296
+ | `eventually(assertion, { timeoutMs = 2000, intervalMs = 20 })` | retries until the assertion passes; when the time is up, fails quoting the last error |
297
+ | `collectEvents(subscriber, types)` | records published integration events: `received(type?)`, `waitFor(type, predicate?, options?)`, `stop()` |
298
+
299
+ The assertions are those of `node:assert`: they read the same under any runner.
300
+
301
+ **Arrange through the API.** An end-to-end test creates its state the way a client would,
302
+ never by writing rows. The builder that gives the aggregate to unit tests gives the request
303
+ payload here, from the same properties and the same vocabulary:
304
+
305
+ ```ts
306
+ class OrderBuilder extends Builder<OrderProps, Order> {
307
+ // defaults(), construct() and the methods of the ubiquitous language, as above
308
+
309
+ buildRequest(): PlaceOrderRequest {
310
+ const { customer, lines } = this.props(); // the defaults and what the test stated, resolved
311
+ return { customerId: customer.id, lines };
312
+ }
313
+ }
314
+
315
+ const { body: order } = expectStatus(await client.post<OrderView>('/orders', anOrder().withLine(aLine()).buildRequest()), 201);
316
+ ```
317
+
318
+ **Reset between tests.** The harness names the contract and leaves the implementation to the
319
+ project and its driver:
320
+
321
+ ```ts
322
+ import type { DatabaseReset } from '@ddd-ts-kit/testing/e2e';
323
+
324
+ // PostgreSQL, with any client exposing `query`: every table of the application schemas.
325
+ export function truncateAllTables(db: { query(sql: string): Promise<{ rows: { name: string }[] }> }, schemas: string[]): DatabaseReset {
326
+ return {
327
+ async reset() {
328
+ const { rows } = await db.query(
329
+ `select quote_ident(schemaname) || '.' || quote_ident(tablename) as name
330
+ from pg_tables where schemaname in (${schemas.map((schema) => `'${schema}'`).join(', ')})`,
331
+ );
332
+ if (rows.length > 0) {
333
+ await db.query(`truncate ${rows.map((row) => row.name).join(', ')} restart identity cascade`);
334
+ }
335
+ },
336
+ };
337
+ }
338
+
339
+ beforeEach(() => database.reset());
340
+ ```
341
+
342
+ ## Three levels with the same vocabulary
343
+
344
+ One rule, "an order that is already paid cannot be paid again", at three of the four test
345
+ levels of `docs/ARCHITECTURE.md` (the adapter level is the contract suites, below). The builder is the same; only what runs underneath changes.
346
+
347
+ ```ts
348
+ // 1. Domain: the aggregate alone. Milliseconds, no double.
349
+ it('refuses to pay an order twice', () => {
350
+ given(anOrder().paid())
351
+ .when((order) => order.pay(at))
352
+ .thenError(OrderAlreadyPaid, 'ORDER_ALREADY_PAID');
353
+ });
354
+
355
+ // 2. Application: the real handler through the bus, fakes for the ports.
356
+ it('refuses to pay an order twice', async () => {
357
+ const orders = new InMemoryOrderRepository();
358
+ const app = createTestApplication({ modules: [orderingModule], fakes: [fake(OrderRepository, orders)] });
359
+ const order = anOrder().paid().build();
360
+ await orders.save(order);
361
+
362
+ await expect(app.commandBus.execute(new PayOrder(order.id))).rejects.toMatchObject({ code: 'ORDER_ALREADY_PAID' });
363
+ expect(app.eventBus.published).toEqual([]);
364
+ });
365
+
366
+ // 3. End to end: HTTP, the real database and broker, generated data, state made through the API.
367
+ it('refuses to pay an order twice', async () => {
368
+ const events = collectEvents(broker, [OrderPaid]);
369
+ const { body: order } = expectStatus(await client.post<OrderView>('/orders', anOrder().buildRequest()), 201);
370
+ expectStatus(await client.post(`/orders/${order.id}/payment`), 204);
371
+
372
+ expectProblem(await client.post(`/orders/${order.id}/payment`), { status: 409, code: 'ORDER_ALREADY_PAID' });
373
+
374
+ await events.waitFor(OrderPaid, (event) => event.payload.orderId === order.id);
375
+ await eventually(async () => expect((await client.get<OrderView>(`/orders/${order.id}`)).body.status).toBe('paid'));
376
+ expect(events.received(OrderPaid)).toHaveLength(1);
377
+ });
378
+ ```
379
+
380
+ Level 2 uses `createTestApplication` and `fake` of `@ddd-ts-kit/di`: the port, an abstract
381
+ class, is what the fake is bound under. With another container,
382
+ `createTestBuses()` above gives the same buses to register the handler on. At level 3 the
383
+ customer of `anOrder()` is generated, the order line is whatever the default says, and the
384
+ only values the test states are the ones the rule depends on: the order is paid, then paid
385
+ again.
386
+
387
+ ## Contract suites
388
+
389
+ A fake is only worth trusting if it behaves like the adapter it stands for. Each suite takes
390
+ the runner's functions and a factory, and is run against both.
391
+
392
+ ```ts
393
+ // contexts/ordering/test/integration/order-repository.contract.spec.ts
394
+ import { afterEach, beforeEach, describe, expect, it } from 'vitest';
395
+ import { repositoryContract } from '@ddd-ts-kit/testing/contracts';
396
+
397
+ const runner = { describe, it, expect, beforeEach, afterEach };
398
+ const options = {
399
+ createAggregate: () => anOrder().build(),
400
+ mutate: (order: Order) => order.addLine(aLine().build()),
401
+ idOf: (order: Order) => order.id,
402
+ stateOf: (order: Order) => order.toSnapshot(),
403
+ };
404
+
405
+ repositoryContract(runner, { ...options, name: 'InMemoryOrderRepository', createRepository: () => new InMemoryOrderRepository() });
406
+ repositoryContract(runner, { ...options, name: 'DrizzleOrderRepository', createRepository: () => freshDrizzleRepository() });
407
+ ```
408
+
409
+ | Suite | Holds |
410
+ |---|---|
411
+ | `repositoryContract` | save then find, unknown id, update, isolation of the stored copy, optimistic concurrency (any error with code `CONCURRENCY_CONFLICT`) |
412
+ | `eventBusContract` | any `EventBus` provider: routing by type, several subscribers, unsubscribe, exact envelope round trip (`traceparent`, `correlationId`), handler failure surfaces. Redeliveries are accepted; return `settle()` from `createBus` for providers that deliver asynchronously |
413
+ | `unitOfWorkContract` | any `UnitOfWork`, called through `run` without a command bus: domain events wait for the end and are dispatched before the commit, so handlers see every save and what they write, the outbox included, commits with it; a failure in a save, in the work, in a handler or in the commit (a deferred constraint) leaves nothing behind; `after-commit` handlers run once the rows are committed, never otherwise. An adapter not built on `withinUnitOfWork` fails here |
414
+ | `outboxStoreContract` | any outbox store: order, limit, lease, concurrent claims, published, failed, dead, `retryDead`, purge |
415
+ | `processedEventStoreContract` | any `ProcessedEventStore`: once per consumer and event, also under concurrent deliveries |
416
+ | `cacheContract` | any `Cache`: round trip of every shape of value, isolation of entries, deletion, time to live |
417
+ | `lockContract` | any `Lock`: one holder at a time also under concurrent requests, release, expiry, a late release ignored, growing fencing token, `waitMs` |
418
+ | `jobSchedulerContract` | any `JobScheduler`: registration and description, a duplicate name and an unreadable schedule refused, `runNow` (also for a disabled job, an unknown name rejected), nothing by time before `start` or after `stop`, no overlap by default, a failing job answered `failed` with its code while the others go on, the execution context of a run |
419
+ | `loggerContract` | any `Logger`: every level with its message and fields of every shape, level and message that no field forges, children that add their fields and nest, fields read at each entry, an entry below the level dropped without reading a field, `isLevelEnabled` answering what is written (for a child too), no throw on a circular field or a getter that throws, at the top of the fields included; an `Error` passed as a field written as its description (`type`, `code` of a `DomainError`, `message`, own `stack`, `cause`, eight errors deep at most), its message replaced when the logger scrubs unless it is a `DomainError`; every entry in the sink once `flush()` resolves, then no throw from a log call or a second flush. `createLogger({ level, fields, scrubMessages })` answers the logger and `lines()`, what its sink received as `{ level, message, fields }`. No capability flag: `InMemoryLogger` takes the same three options and passes the whole suite |
420
+ | `criteriaContract` | any translator of criteria, the in-memory evaluator included: a table of criteria and the ids each answers, in order, over eight fixed rows. Every operator on every type it applies to, decimals as numbers, instants to the millisecond and across zones, case and the characters a `LIKE` would trip on, nulls under each operator, `and`, `or`, `not` and what a negation does to a null, sorts with ties and nulls in both directions, offset pages with their total, every sort walked by cursor one and two rows at a time, the four kinds of access scope, and hostile values. `createReadModel(rows)` answers `{ search(scopedCriteria) }` over exactly those rows, read with `criteriaContractDefinition` |
421
+ | `readModelStoreContract` | any `ReadModelTable` under `TableReadModelStore`: rows of every type round trip, the current row handed to a later event, an event applied once, never one older than the row, order by event id at the same instant and by version when given, concurrent writes ending on the latest, deletions that last, listing by criteria and scope, and `ProjectionRebuild`: rebuilt from the source alone, no event lost while it exports (on a row already copied and on one not yet), stale and new events after the swap, deletions during and before it, a failed export leaving the table as it was, the table still itself after two rebuilds. `createTable()` answers `{ table, unitOfWork }`; `SourceOfTruth` is the fake of the source |
422
+ | `rateLimiterContract` | any `RateLimiter`: limit, `remaining` and `retryAfterMs`, refused calls not counted, sliding window, isolation of keys, concurrent calls |
423
+
424
+ The cache, lock and rate limiter suites also take `elapse(ms)`, which makes time pass for the
425
+ subject: advance the clock it reads, or really wait when the time is a server's. The job
426
+ scheduler suite takes it from `createScheduler`, with the scheduler and the scope it runs its
427
+ jobs in: `{ scheduler, scope, elapse }`. It asks for a few seconds at most, with jobs of every
428
+ second.
429
+
430
+ The unit of work suite takes `createUnitOfWork`, called before each test, which answers a
431
+ `UnitOfWorkUnderContract` over an empty table and an empty outbox:
432
+ `{ unitOfWork, outbox, insert(id), insertRefusedAtCommit(id), ids(), committedIds?(), close?() }`.
433
+ The table holds an identifier under a primary key and a reference to a row of the same table
434
+ that the database checks at commit only (a deferred constraint): `insertRefusedAtCommit` writes
435
+ a row the commit refuses. Give `committedIds`, what another connection sees, where the
436
+ database serves several connections: the suite then also proves that the rows of a
437
+ `before-commit` handler are invisible from outside the transaction and visible to the
438
+ `after-commit` handlers.
439
+
440
+ The suites use only `describe`, `it`, `beforeEach`, `expect(...).toBe` and `toEqual`
441
+ (`afterEach` is optional), which the globals of vitest and jest both provide: that part of a
442
+ runner is the `ContractRunner` type.
443
+
444
+ A package that holds a port of its own publishes its contract on the same base, `ContractSuite`:
445
+ a subject created anew before each test, and `it`, `expect`, `afterEach` bound to the runner.
446
+
447
+ ```ts
448
+ import { ContractSuite, type Awaitable, type ContractRunner } from '@ddd-ts-kit/testing/contracts';
449
+
450
+ export function geocoderContract(runner: ContractRunner, options: { name: string; create(): Awaitable<Geocoder> }): void {
451
+ new GeocoderSuite(runner, () => options.create()).describe(`${options.name} (geocoder contract)`);
452
+ }
453
+
454
+ class GeocoderSuite extends ContractSuite<Geocoder> {
455
+ protected tests(): void {
456
+ this.it('answers undefined for an address it does not know', async () => {
457
+ this.expect(await this.subject.locate('nowhere')).toBe(undefined);
458
+ });
459
+ }
460
+ }
461
+ ```
462
+
463
+ ## Secrets an adapter must not show
464
+
465
+ An adapter is logged, spread into a diagnostic and serialised by code that knows nothing of
466
+ what it holds. `expectNoSecret(adapter, [password, url])` asserts that none of the given values
467
+ shows through `JSON.stringify`, an object spread, the values `Object.keys` leads to, or
468
+ `util.inspect` at any depth, hidden properties included. The failure names the view and the
469
+ rank of the secret, never its value.
470
+
471
+ ```ts
472
+ import { expectNoSecret } from '@ddd-ts-kit/testing';
473
+
474
+ it('shows no credential', () => {
475
+ const bus = new KafkaEventBus({ brokers, client: { 'sasl.password': password } });
476
+
477
+ expectNoSecret(bus, [password]);
478
+ });
479
+ ```
480
+
481
+ ## Standard decorators under Vitest
482
+
483
+ Vitest 5 (Vite 8, Oxc) lowers legacy decorators and does not lower standard (TC39) ones: a
484
+ spec that imports a `.ts` file holding `@CommandHandler(...)` or `@Retry(...)` stops on a
485
+ syntax error. `decorators()` closes that gap, and only that one.
486
+
487
+ ```ts
488
+ // vitest.config.ts
489
+ import { defineConfig } from 'vitest/config';
490
+ import { decorators } from '@ddd-ts-kit/testing/vitest';
491
+
492
+ export default defineConfig({ plugins: [decorators()] });
493
+ ```
494
+
495
+ - **What it does.** A `.ts`, `.mts` or `.cts` file with a line that starts with a decorator is
496
+ compiled by the TypeScript compiler of the project before the runner reads it; every other
497
+ file is left to the runner. Imports are kept as written, for the runner to resolve.
498
+ - **Which options it follows.** `target`, `useDefineForClassFields`, `verbatimModuleSyntax`
499
+ and `experimentalDecorators`, read from the `tsconfig.json` nearest to each file (the one
500
+ the runner follows too), or from the `tsconfig` option. A target of `ESNext` would leave
501
+ the decorators in place, so `ES2024` stands in for it.
502
+ - **It steps aside in the legacy mode.** Under `experimentalDecorators: true` it answers
503
+ nothing and the runner lowers the decorators itself. A project on class-validator or NestJS
504
+ may keep the plugin in its config or drop it: the result is the same.
505
+ - **Source maps.** The map names the real file and holds its text: stack traces, breakpoints
506
+ and coverage point at the source.
507
+ - **Cache.** One entry per file content, compiler and options, under the cache directory of
508
+ Vite (`cacheDir` option to move it). A file is compiled once, then read back: about 60 ms
509
+ with the native TypeScript 7 and 220 ms with TypeScript 6 the first time, nothing after.
510
+ - **Which compiler.** The `tsc` of the `typescript` package the project installs, from 5.6,
511
+ the native TypeScript 7 included: it runs the compiler binary, not its JavaScript API,
512
+ which the native compiler does not have. `compiler` names another package or a path.
513
+
514
+ | Option | Default |
515
+ |---|---|
516
+ | `tsconfig` | the nearest `tsconfig.json` above each file |
517
+ | `compiler` | `typescript` |
518
+ | `cacheDir` | `ddd-ts-kit-decorators` in the cache directory of Vite |
519
+
520
+ It does not type-check (the build does), and it does not touch `.tsx`.
521
+
522
+ ## Coverage thresholds read from the config
523
+
524
+ `@ddd-ts-kit/testing/coverage` gives the test runner what it measures and the floor it is held
525
+ to, read from the `coverage` key of `ddd-ts-kit.config.json` (the reference when the key is
526
+ absent), so that no threshold is written in a runner config:
527
+
528
+ ```ts
529
+ // vitest.config.ts
530
+ import { governedCoverage } from '@ddd-ts-kit/testing/coverage';
531
+ import { defineConfig } from 'vitest/config';
532
+
533
+ export default defineConfig(({ mode }) => ({
534
+ test: { coverage: { provider: 'v8', reporter: ['text', 'lcov'], ...governedCoverage(mode) } },
535
+ }));
536
+ ```
537
+
538
+ - `include`: the layers of every context the run executes, the files no spec loads included.
539
+ `--mode unit` measures `domain`, `application` and `presentation`, `--mode integration`
540
+ measures `infrastructure`, any other mode the four.
541
+ - `thresholds`: one entry per context and layer that holds a source file, so a context cannot
542
+ hide behind another and an empty layer is held to nothing until its first file.
543
+ - `governedJestCoverage()` gives the same as `collectCoverageFrom` and `coverageThreshold`.
544
+ - `REFERENCE_COVERAGE` is the reference: domain 90/85/90/90, application 85/80/85/85,
545
+ presentation 80/70/80/80, infrastructure 70/60/70/70 (statements, branches, functions, lines).
546
+
547
+ Under the legacy decorator mode with `emitDecoratorMetadata`, add `decoratorCoverage()` of
548
+ `@ddd-ts-kit/testing/vitest` to `plugins`: the statements the transform writes to apply
549
+ decorators hold, for every type a decorated class names, a branch no test can take; the plugin
550
+ marks them with the hint the `v8` provider reads, as the provider does by itself for SWC.
@@ -0,0 +1,7 @@
1
+ import type { Resolvable } from './resolvable.js';
2
+ /**
3
+ * What a builder accepts wherever a value of type `T` is expected: the value, something that
4
+ * yields it at build time, or, for an array, a list mixing both.
5
+ */
6
+ export type Buildable<T> = T | Resolvable<T> | (T extends readonly (infer Item)[] ? readonly Buildable<Item>[] : never);
7
+ //# sourceMappingURL=buildable.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buildable.d.ts","sourceRoot":"","sources":["../../src/builders/buildable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD;;;GAGG;AACH,MAAM,MAAM,SAAS,CAAC,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,SAAS,SAAS,CAAC,MAAM,IAAI,CAAC,EAAE,GAAG,SAAS,SAAS,CAAC,IAAI,CAAC,EAAE,GAAG,KAAK,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=buildable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buildable.js","sourceRoot":"","sources":["../../src/builders/buildable.ts"],"names":[],"mappings":""}
@@ -0,0 +1,33 @@
1
+ import type { Buildable } from './buildable.js';
2
+ import type { Defaults } from './defaults.js';
3
+ import { RESOLVE, type Resolvable } from './resolvable.js';
4
+ /**
5
+ * Base class of hand-written test data builders.
6
+ *
7
+ * A subclass declares valid `defaults()` once, says in `construct()` how to create the object
8
+ * through its public API, and exposes methods named in the ubiquitous language that delegate
9
+ * to the protected `with`. Every such method returns a new builder: a builder is immutable,
10
+ * so one instance can be shared between tests without leaking state.
11
+ */
12
+ export declare abstract class Builder<Props extends object, Output> implements Resolvable<Output> {
13
+ private readonly overrides;
14
+ /** Valid defaults. Called at each build, so `lazy` and `sequence` yield fresh values. */
15
+ protected abstract defaults(): Defaults<Props>;
16
+ /** Creates the object through its public API, so it can never start in an invalid state. */
17
+ protected abstract construct(props: Props): Output;
18
+ build(): Output;
19
+ /** Builds `count` objects, each with its own lazy and sequence values. */
20
+ buildMany(count: number, customize?: (builder: this, index: number) => this): Output[];
21
+ [RESOLVE](): Output;
22
+ /**
23
+ * What `build()` hands to `construct`: the defaults, then the values set, all resolved. A
24
+ * subclass uses it to offer another output of the same vocabulary, such as the request
25
+ * payload of an API (`buildRequest()`). Each call draws its own lazy and sequence values.
26
+ */
27
+ protected props(): Props;
28
+ /** Adds items to an array property, after the ones already set or declared by default. */
29
+ protected adding<K extends keyof Props>(key: K, ...items: Props[K] extends readonly (infer Item)[] ? Buildable<Item>[] : never): this;
30
+ protected with<K extends keyof Props>(key: K, value: Buildable<Props[K]>): this;
31
+ protected withMany(values: Partial<Defaults<Props>>): this;
32
+ }
33
+ //# sourceMappingURL=builder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"builder.d.ts","sourceRoot":"","sources":["../../src/builders/builder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,EAAE,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE3D;;;;;;;GAOG;AACH,8BAAsB,OAAO,CAAC,KAAK,SAAS,MAAM,EAAE,MAAM,CAAE,YAAW,UAAU,CAAC,MAAM,CAAC;IAEvF,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAgC;IAE1D,yFAAyF;IACzF,SAAS,CAAC,QAAQ,CAAC,QAAQ,IAAI,QAAQ,CAAC,KAAK,CAAC,CAAC;IAE/C,4FAA4F;IAC5F,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CAAC;IAEnD,KAAK,IAAI,MAAM,CAEd;IAED,0EAA0E;IAC1E,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,GAAE,CAAC,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,KAAK,IAAe,GAAG,MAAM,EAAE,CAE/F;IAED,CAAC,OAAO,CAAC,IAAI,MAAM,CAElB;IAED;;;;OAIG;IACH,SAAS,CAAC,KAAK,IAAI,KAAK,CAOvB;IAED,0FAA0F;IAC1F,SAAS,CAAC,MAAM,CAAC,CAAC,SAAS,MAAM,KAAK,EACpC,GAAG,EAAE,CAAC,EACN,GAAG,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,SAAS,SAAS,CAAC,MAAM,IAAI,CAAC,EAAE,GAAG,SAAS,CAAC,IAAI,CAAC,EAAE,GAAG,KAAK,GAC7E,IAAI,CAWN;IAED,SAAS,CAAC,IAAI,CAAC,CAAC,SAAS,MAAM,KAAK,EAAE,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAM9E;IAED,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,CAKzD;CACF"}