testeranto 0.140.2 → 0.143.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 (130) hide show
  1. package/.aider.chat.history.md +9173 -0
  2. package/.aider.input.history +336 -0
  3. package/.aider.tags.cache.v3/{ad/3c/10f2ab1397f6d544e613d2a6acaf.val → 3d/81/8b6f0e9b98ec2952cdb8968ac386.val} +0 -0
  4. package/.aider.tags.cache.v3/63/f1/138061b0aadb868173d197c2a0e0.val +0 -0
  5. package/.aider.tags.cache.v3/be/72/19ee8e656d160afe9b31523245fe.val +0 -0
  6. package/.aider.tags.cache.v3/cache.db +0 -0
  7. package/.aider.tags.cache.v3/cache.db-shm +0 -0
  8. package/.aider.tags.cache.v3/cache.db-wal +0 -0
  9. package/.aider.tags.cache.v3/{a7/97/6d37fce350ad2d588f36729db0cd.val → d6/7d/1820c2d4b9330eab7017da4515e7.val} +0 -0
  10. package/docs/aiderTest.sh +1 -0
  11. package/docs/testing.ai.txt +98 -0
  12. package/docs/testing.prompt.txt +8 -0
  13. package/package.json +3 -3
  14. package/src/PM/PM_WithEslintAndTsc.ts +35 -21
  15. package/src/Pure.test.ts +299 -0
  16. package/src/lib/BaseSuite.test.ts +24 -5
  17. package/src/lib/abstractBase.test/MockGiven.ts +31 -0
  18. package/src/lib/abstractBase.test/MockThen.ts +20 -0
  19. package/src/lib/abstractBase.test/MockWhen.ts +17 -0
  20. package/src/lib/abstractBase.test/implementation.ts +51 -0
  21. package/src/lib/abstractBase.test/index.ts +19 -0
  22. package/src/lib/abstractBase.test/interface.ts +12 -0
  23. package/src/lib/abstractBase.test/specification.ts +49 -0
  24. package/src/lib/abstractBase.test/types.ts +19 -0
  25. package/src/lib/baseBuilder.test/TestBaseBuilder.ts +83 -0
  26. package/src/lib/baseBuilder.test/baseBuilder.test.implementation.ts +133 -0
  27. package/src/lib/baseBuilder.test/baseBuilder.test.interface.ts +18 -0
  28. package/src/lib/baseBuilder.test/baseBuilder.test.specification.ts +35 -0
  29. package/src/lib/baseBuilder.test/baseBuilder.test.ts +13 -0
  30. package/src/lib/baseBuilder.test/baseBuilder.test.types.ts +36 -0
  31. package/src/lib/classBuilder.test/TestClassBuilder.ts +88 -0
  32. package/src/lib/classBuilder.test/classBuilder.test.implementation.ts +200 -0
  33. package/src/lib/classBuilder.test/classBuilder.test.interface.ts +17 -0
  34. package/src/lib/classBuilder.test/classBuilder.test.specification.ts +112 -0
  35. package/src/lib/classBuilder.test/classBuilder.test.ts +14 -0
  36. package/src/lib/classBuilder.test/classBuilder.test.types.ts +72 -0
  37. package/src/lib/core.test/MockCore.ts +49 -0
  38. package/src/lib/core.test/core.test.implementation.ts +129 -0
  39. package/src/lib/core.test/core.test.interface.ts +18 -0
  40. package/src/lib/core.test/core.test.specification.ts +99 -0
  41. package/src/lib/core.test/core.test.ts +15 -0
  42. package/src/lib/core.test/core.test.types.ts +68 -0
  43. package/src/lib/core.ts +1 -1
  44. package/src/lib/pmProxy.test/implementation.ts +104 -0
  45. package/src/lib/pmProxy.test/index.ts +19 -0
  46. package/src/lib/pmProxy.test/interface.ts +47 -0
  47. package/src/lib/pmProxy.test/mockPM.ts +38 -0
  48. package/src/lib/pmProxy.test/mockPMBase.ts +136 -0
  49. package/src/lib/pmProxy.test/specification.ts +123 -0
  50. package/src/lib/pmProxy.test/types.ts +45 -0
  51. package/src/lib/pmProxy.ts +40 -193
  52. package/testeranto/bundles/node/allTests/chunk-2FXOXAKZ.mjs +800 -0
  53. package/testeranto/bundles/node/allTests/chunk-5MQGD4WC.mjs +251 -0
  54. package/testeranto/bundles/node/allTests/chunk-6CGAD2FD.mjs +800 -0
  55. package/testeranto/bundles/node/allTests/chunk-DWKHII32.mjs +800 -0
  56. package/testeranto/bundles/node/allTests/chunk-KYSOR62N.mjs +167 -0
  57. package/testeranto/bundles/node/allTests/chunk-PRPFVO6G.mjs +251 -0
  58. package/testeranto/bundles/node/allTests/chunk-RX4SUFXQ.mjs +251 -0
  59. package/testeranto/bundles/node/allTests/chunk-UED26IMH.mjs +802 -0
  60. package/testeranto/bundles/node/allTests/chunk-VAAIAWXC.mjs +117 -0
  61. package/testeranto/bundles/node/allTests/chunk-W44DUDBK.mjs +251 -0
  62. package/testeranto/bundles/node/allTests/chunk-YI3EGRMQ.mjs +167 -0
  63. package/testeranto/bundles/node/allTests/metafile.json +1072 -222
  64. package/testeranto/bundles/node/allTests/src/PM/__tests__/nodeSidecar.testeranto.mjs +2 -1
  65. package/testeranto/bundles/node/allTests/src/PM/__tests__/pureSidecar.testeranto.mjs +2 -1
  66. package/testeranto/bundles/node/allTests/src/PM/__tests__/webSidecar.testeranto.mjs +2 -1
  67. package/testeranto/bundles/node/allTests/src/Pure.test.mjs +261 -0
  68. package/testeranto/bundles/node/allTests/src/lib/BaseSuite.test.mjs +22 -4
  69. package/testeranto/bundles/node/allTests/src/lib/baseBuilder.test/baseBuilder.test.mjs +226 -0
  70. package/testeranto/bundles/node/allTests/src/lib/classBuilder.test/classBuilder.test.mjs +406 -0
  71. package/testeranto/bundles/node/allTests/src/lib/core.test/core.test.mjs +279 -0
  72. package/testeranto/bundles/node/allTests/src/lib/pmProxy.test/index.mjs +4479 -0
  73. package/testeranto/bundles/node/allTests/src/mothership/test.mjs +4 -2
  74. package/testeranto/reports/allTests/config.json +40 -1
  75. package/testeranto/reports/allTests/src/PM/__tests__/nodeSidecar.testeranto/node/console_log.txt +0 -0
  76. package/testeranto/reports/allTests/src/PM/__tests__/nodeSidecar.testeranto/node/log.txt +0 -0
  77. package/testeranto/reports/allTests/src/Pure.test/node/console_log.txt +17 -0
  78. package/testeranto/reports/allTests/src/Pure.test/node/dev.html +21 -0
  79. package/testeranto/reports/allTests/src/Pure.test/node/index.html +21 -0
  80. package/testeranto/reports/allTests/src/Pure.test/node/lint_errors.json +134 -0
  81. package/testeranto/reports/allTests/src/Pure.test/node/message +1 -0
  82. package/testeranto/reports/allTests/src/Pure.test/node/prompt.txt +7 -0
  83. package/testeranto/reports/allTests/src/Pure.test/node/type_errors.txt +26 -0
  84. package/testeranto/reports/allTests/src/lib/BaseGiven.test/node/dev.html +21 -0
  85. package/testeranto/reports/allTests/src/lib/BaseGiven.test/node/index.html +21 -0
  86. package/testeranto/reports/allTests/src/lib/BaseSuite.test/node/console_log.txt +27 -27
  87. package/testeranto/reports/allTests/src/lib/BaseSuite.test/node/lint_errors.json +104 -104
  88. package/testeranto/reports/allTests/src/lib/BaseSuite.test/node/type_errors.txt +47 -22
  89. package/testeranto/reports/allTests/src/lib/BaseThen.test/node/dev.html +21 -0
  90. package/testeranto/reports/allTests/src/lib/BaseThen.test/node/index.html +21 -0
  91. package/testeranto/reports/allTests/src/lib/BaseWhen.test/node/dev.html +21 -0
  92. package/testeranto/reports/allTests/src/lib/BaseWhen.test/node/index.html +21 -0
  93. package/testeranto/reports/allTests/src/lib/abstractBase/index/node/dev.html +21 -0
  94. package/testeranto/reports/allTests/src/lib/abstractBase/index/node/index.html +21 -0
  95. package/testeranto/reports/allTests/src/lib/baseBuilder/baseBuilder.test/node/dev.html +21 -0
  96. package/testeranto/reports/allTests/src/lib/baseBuilder/baseBuilder.test/node/index.html +21 -0
  97. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test/node/console_log.txt +12 -0
  98. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test/node/dev.html +21 -0
  99. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test/node/index.html +21 -0
  100. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test/node/lint_errors.json +966 -0
  101. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test/node/message +1 -0
  102. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test/node/prompt.txt +11 -0
  103. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test/node/type_errors.txt +52 -0
  104. package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/console_log.txt +17 -0
  105. package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/dev.html +21 -0
  106. package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/index.html +21 -0
  107. package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/lint_errors.json +771 -0
  108. package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/message +1 -0
  109. package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/prompt.txt +11 -0
  110. package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/type_errors.txt +67 -0
  111. package/testeranto/reports/allTests/src/lib/core.test/core.test/node/console_log.txt +17 -0
  112. package/testeranto/reports/allTests/src/lib/core.test/core.test/node/dev.html +21 -0
  113. package/testeranto/reports/allTests/src/lib/core.test/core.test/node/index.html +21 -0
  114. package/testeranto/reports/allTests/src/lib/core.test/core.test/node/lint_errors.json +416 -0
  115. package/testeranto/reports/allTests/src/lib/core.test/core.test/node/message +1 -0
  116. package/testeranto/reports/allTests/src/lib/core.test/core.test/node/prompt.txt +11 -0
  117. package/testeranto/reports/allTests/src/lib/core.test/core.test/node/type_errors.txt +54 -0
  118. package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/console_log.txt +43 -0
  119. package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/dev.html +21 -0
  120. package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/index.html +21 -0
  121. package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/lint_errors.json +319 -0
  122. package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/log.txt +0 -0
  123. package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/message +1 -0
  124. package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/prompt.txt +10 -0
  125. package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/type_errors.txt +64 -0
  126. package/testeranto/reports/allTests/src/mothership/test/node/console_log.txt +44 -0
  127. package/testeranto/reports/allTests/src/mothership/test/node/log.txt +0 -0
  128. package/testeranto/reports/allTests/summary.json +76 -6
  129. package/testeranto/reportsnode_build_errors +12 -0
  130. package/testeranto.config.ts +19 -2
@@ -4,7 +4,8 @@ import {
4
4
  } from "../../../chunk-PG6KUKNP.mjs";
5
5
  import {
6
6
  Node_default
7
- } from "../../../chunk-4PJCC2XT.mjs";
7
+ } from "../../../chunk-W44DUDBK.mjs";
8
+ import "../../../chunk-UED26IMH.mjs";
8
9
 
9
10
  // src/PM/nodeSidecar.ts
10
11
  import net from "net";
@@ -4,7 +4,8 @@ import {
4
4
  } from "../../../chunk-PG6KUKNP.mjs";
5
5
  import {
6
6
  Node_default
7
- } from "../../../chunk-4PJCC2XT.mjs";
7
+ } from "../../../chunk-W44DUDBK.mjs";
8
+ import "../../../chunk-UED26IMH.mjs";
8
9
 
9
10
  // src/PM/pureSidecar.ts
10
11
  import net from "net";
@@ -4,7 +4,8 @@ import {
4
4
  } from "../../../chunk-PG6KUKNP.mjs";
5
5
  import {
6
6
  Node_default
7
- } from "../../../chunk-4PJCC2XT.mjs";
7
+ } from "../../../chunk-W44DUDBK.mjs";
8
+ import "../../../chunk-UED26IMH.mjs";
8
9
 
9
10
  // src/PM/webSidecar.ts
10
11
  import net from "net";
@@ -0,0 +1,261 @@
1
+ import { createRequire } from 'module';const require = createRequire(import.meta.url);
2
+ import {
3
+ MockPMBase
4
+ } from "../chunk-VAAIAWXC.mjs";
5
+ import {
6
+ Pure_default
7
+ } from "../chunk-KYSOR62N.mjs";
8
+ import "../chunk-UED26IMH.mjs";
9
+
10
+ // src/Pure.test.ts
11
+ var implementation = {
12
+ suites: {
13
+ Default: "PureTesteranto Test Suite"
14
+ },
15
+ givens: {
16
+ Default: () => ({
17
+ pm: new MockPMBase(),
18
+ config: {},
19
+ proxies: {
20
+ butThenProxy: (pm, path) => ({
21
+ ...pm,
22
+ writeFileSync: (p, c) => pm.writeFileSync(`${path}/butThen/${p}`, c)
23
+ }),
24
+ andWhenProxy: (pm, path) => ({
25
+ ...pm,
26
+ writeFileSync: (p, c) => pm.writeFileSync(`${path}/andWhen/${p}`, c)
27
+ }),
28
+ beforeEachProxy: (pm, suite) => ({
29
+ ...pm,
30
+ writeFileSync: (p, c) => pm.writeFileSync(`suite-${suite}/beforeEach/${p}`, c)
31
+ })
32
+ }
33
+ })
34
+ },
35
+ whens: {
36
+ applyProxy: (proxyType) => (store) => {
37
+ switch (proxyType) {
38
+ case "invalidConfig":
39
+ throw new Error("Invalid configuration");
40
+ case "missingProxy":
41
+ return { ...store, pm: {} };
42
+ case "largePayload":
43
+ return {
44
+ ...store,
45
+ largePayload: true,
46
+ pm: {
47
+ ...store.pm,
48
+ writeFileSync: (p, c) => {
49
+ if (c.length > 1e6) {
50
+ return true;
51
+ }
52
+ throw new Error("Payload too small");
53
+ }
54
+ }
55
+ };
56
+ default:
57
+ return store;
58
+ }
59
+ }
60
+ },
61
+ thens: {
62
+ verifyProxy: (expectedPath) => (store) => {
63
+ const testPath = "expected";
64
+ const result = store.pm.writeFileSync(testPath, "content");
65
+ const actualPath = store.pm.getLastCall("writeFileSync")?.path;
66
+ if (actualPath !== expectedPath) {
67
+ throw new Error(`Expected path ${expectedPath}, got ${actualPath}`);
68
+ }
69
+ return store;
70
+ },
71
+ verifyNoProxy: () => (store) => {
72
+ if (store.pm.getCallCount("writeFileSync") > 0) {
73
+ throw new Error("Proxy was unexpectedly applied");
74
+ }
75
+ return store;
76
+ },
77
+ verifyError: (expectedError) => (store) => {
78
+ try {
79
+ store.pm.writeFileSync("test", "content");
80
+ throw new Error("Expected error but none was thrown");
81
+ } catch (error) {
82
+ if (!error.message.includes(expectedError)) {
83
+ throw new Error(`Expected error "${expectedError}", got "${error.message}"`);
84
+ }
85
+ }
86
+ return store;
87
+ },
88
+ verifyResourceConfig: () => (store) => {
89
+ if (!store.pm.testResourceConfiguration) {
90
+ throw new Error("Missing test resource configuration");
91
+ }
92
+ return store;
93
+ },
94
+ verifyLargePayload: () => (store) => {
95
+ const largeContent = "x".repeat(2e6);
96
+ const result = store.pm.writeFileSync("large.txt", largeContent);
97
+ if (!result) {
98
+ throw new Error("Failed to handle large payload");
99
+ }
100
+ return store;
101
+ },
102
+ verifyTypeSafety: () => (store) => {
103
+ return store;
104
+ }
105
+ },
106
+ checks: {
107
+ Default: () => ({})
108
+ }
109
+ };
110
+ var specification = (Suite, Given, When, Then, Check) => [
111
+ Suite.Default("Core Functionality", {
112
+ initializationTest: Given.Default(
113
+ ["Should initialize with default configuration"],
114
+ [],
115
+ [Then.verifyNoProxy()]
116
+ ),
117
+ resourceConfigTest: Given.Default(
118
+ ["Should handle test resource configuration"],
119
+ [When.applyProxy("resourceConfig")],
120
+ [Then.verifyResourceConfig()]
121
+ )
122
+ }),
123
+ Suite.Default("Proxy Integration", {
124
+ butThenProxyTest: Given.Default(
125
+ ["Should integrate with butThenProxy"],
126
+ [When.applyProxy("butThenProxy")],
127
+ [Then.verifyProxy("test/path/butThen/expected")]
128
+ ),
129
+ andWhenProxyTest: Given.Default(
130
+ ["Should integrate with andWhenProxy"],
131
+ [When.applyProxy("andWhenProxy")],
132
+ [Then.verifyProxy("test/path/andWhen/expected")]
133
+ ),
134
+ beforeEachProxyTest: Given.Default(
135
+ ["Should integrate with beforeEachProxy"],
136
+ [When.applyProxy("beforeEachProxy")],
137
+ [Then.verifyProxy("suite-1/beforeEach/expected")]
138
+ )
139
+ }),
140
+ Suite.Default("Error Handling", {
141
+ invalidConfigTest: Given.Default(
142
+ ["Should handle invalid configuration"],
143
+ [When.applyProxy("invalidConfig")],
144
+ [Then.verifyError("Invalid configuration")]
145
+ ),
146
+ missingProxyTest: Given.Default(
147
+ ["Should handle missing proxy"],
148
+ [When.applyProxy("missingProxy")],
149
+ [Then.verifyError("Proxy not found")]
150
+ )
151
+ }),
152
+ Suite.Default("Performance", {
153
+ multipleProxiesTest: Given.Default(
154
+ ["Should handle multiple proxies efficiently"],
155
+ [
156
+ When.applyProxy("butThenProxy"),
157
+ When.applyProxy("andWhenProxy"),
158
+ When.applyProxy("beforeEachProxy")
159
+ ],
160
+ [
161
+ Then.verifyProxy("test/path/butThen/expected"),
162
+ Then.verifyProxy("test/path/andWhen/expected"),
163
+ Then.verifyProxy("suite-1/beforeEach/expected")
164
+ ]
165
+ ),
166
+ largePayloadTest: Given.Default(
167
+ ["Should handle large payloads"],
168
+ [When.applyProxy("largePayload")],
169
+ [Then.verifyLargePayload()]
170
+ )
171
+ }),
172
+ Suite.Default("Cross-Component Verification", {
173
+ proxyChainTest: Given.Default(
174
+ ["Proxies should chain correctly"],
175
+ [
176
+ When.applyProxy("butThenProxy"),
177
+ When.applyProxy("andWhenProxy")
178
+ ],
179
+ [
180
+ Then.verifyProxy("test/path/andWhen/butThen/expected")
181
+ ]
182
+ ),
183
+ errorPropagationTest: Given.Default(
184
+ ["Errors should propagate across components"],
185
+ [When.applyProxy("invalidConfig")],
186
+ [Then.verifyError("Invalid configuration")]
187
+ ),
188
+ resourceSharingTest: Given.Default(
189
+ ["Resources should be shared correctly"],
190
+ [When.applyProxy("resourceConfig")],
191
+ [Then.verifyResourceConfig()]
192
+ )
193
+ }),
194
+ Suite.Default("Type Safety", {
195
+ strictTypeTest: Given.Default(
196
+ ["Should enforce type safety"],
197
+ [When.applyProxy("typeSafe")],
198
+ [Then.verifyTypeSafety()]
199
+ ),
200
+ invalidTypeTest: Given.Default(
201
+ ["Should reject invalid types"],
202
+ [When.applyProxy("invalidType")],
203
+ [Then.verifyError("Type mismatch")]
204
+ )
205
+ }),
206
+ Suite.Default("Integration Tests", {
207
+ // Verify builders work together
208
+ builderIntegration: Given.Default(
209
+ ["BaseBuilder and ClassBuilder should integrate properly"],
210
+ [],
211
+ [
212
+ Then.initializedProperly(),
213
+ Then.specsGenerated(),
214
+ Then.jobsCreated(),
215
+ Then.artifactsTracked()
216
+ ]
217
+ ),
218
+ // Verify PM proxy integration
219
+ pmProxyIntegration: Given.Default(
220
+ ["PM proxies should work with test runners"],
221
+ [When.applyProxy("butThenProxy")],
222
+ [Then.verifyProxy("test/path/butThen/expected")]
223
+ ),
224
+ // Verify full test lifecycle
225
+ fullLifecycle: Given.Default(
226
+ ["Should complete full test lifecycle"],
227
+ [
228
+ When.addArtifact(Promise.resolve("test")),
229
+ When.setTestJobs([]),
230
+ When.modifySpecs((specs) => [...specs])
231
+ ],
232
+ [
233
+ Then.testRunSuccessful(),
234
+ Then.artifactsTracked(),
235
+ Then.specsModified(0)
236
+ ]
237
+ )
238
+ })
239
+ ];
240
+ var testInterface = {
241
+ beforeEach: async (subject, initializer) => {
242
+ return { pm: initializer() };
243
+ },
244
+ andWhen: async (store, whenCB) => whenCB(store),
245
+ butThen: async (store, thenCB) => thenCB(store),
246
+ afterEach: async (store) => store,
247
+ afterAll: async () => {
248
+ },
249
+ beforeAll: async (input, testResource) => ({}),
250
+ assertThis: (x) => x
251
+ };
252
+ var Pure_test_default = Pure_default(
253
+ null,
254
+ // No initial input
255
+ specification,
256
+ implementation,
257
+ testInterface
258
+ );
259
+ export {
260
+ Pure_test_default as default
261
+ };
@@ -1,12 +1,14 @@
1
1
  import { createRequire } from 'module';const require = createRequire(import.meta.url);
2
+ import {
3
+ Node_default
4
+ } from "../../chunk-W44DUDBK.mjs";
2
5
  import {
3
6
  BaseCheck,
4
7
  BaseGiven,
5
8
  BaseSuite,
6
9
  BaseThen,
7
- BaseWhen,
8
- Node_default
9
- } from "../../chunk-4PJCC2XT.mjs";
10
+ BaseWhen
11
+ } from "../../chunk-UED26IMH.mjs";
10
12
 
11
13
  // src/lib/BaseSuite.test.ts
12
14
  var MockGiven = class extends BaseGiven {
@@ -131,7 +133,23 @@ var specification = (Suite, Given, When, Then, Check) => [
131
133
  // ]
132
134
  // )
133
135
  ]
134
- )
136
+ ),
137
+ Suite.Default("Comprehensive Integration", {
138
+ fullStackTest: Given.Default(
139
+ ["All components should work together"],
140
+ [
141
+ When.addArtifact(Promise.resolve("test")),
142
+ When.modifySpecs((specs) => [...specs, "extra"]),
143
+ When.modifyJobs((jobs) => [...jobs, {}])
144
+ ],
145
+ [
146
+ Then.specsModified(1),
147
+ Then.jobsModified(1),
148
+ Then.artifactsTracked(),
149
+ Then.testRunSuccessful()
150
+ ]
151
+ )
152
+ })
135
153
  ];
136
154
  var implementation = {
137
155
  suites: {
@@ -0,0 +1,226 @@
1
+ import { createRequire } from 'module';const require = createRequire(import.meta.url);
2
+ import {
3
+ Node_default
4
+ } from "../../../chunk-W44DUDBK.mjs";
5
+ import {
6
+ BaseBuilder as BaseBuilder2
7
+ } from "../../../chunk-UED26IMH.mjs";
8
+
9
+ // src/lib/baseBuilder.test/baseBuilder.test.specification.ts
10
+ var specification = (Suite, Given, When, Then, Check) => {
11
+ return [
12
+ Suite.Default(
13
+ "Testing BaseBuilder functionality",
14
+ {
15
+ testInitialization: Given.Default(
16
+ ["BaseBuilder should initialize correctly"],
17
+ [],
18
+ [Then.initializedProperly()]
19
+ ),
20
+ testSpecsGeneration: Given.Default(
21
+ ["BaseBuilder should generate specs from test specification"],
22
+ [],
23
+ [Then.specsGenerated()]
24
+ ),
25
+ testJobsCreation: Given.Default(
26
+ ["BaseBuilder should create test jobs"],
27
+ [],
28
+ [Then.jobsCreated()]
29
+ )
30
+ },
31
+ []
32
+ )
33
+ ];
34
+ };
35
+
36
+ // src/lib/baseBuilder.test/baseBuilder.test.implementation.ts
37
+ import { PassThrough } from "stream";
38
+
39
+ // src/lib/baseBuilder.test/TestBaseBuilder.ts
40
+ var TestBaseBuilder = class extends BaseBuilder2 {
41
+ constructor(input, suitesOverrides = {}, givenOverrides = {}, whenOverrides = {}, thenOverrides = {}, checkOverrides = {}, testResourceRequirement = { ports: [] }, testSpecification = () => []) {
42
+ super(
43
+ input,
44
+ suitesOverrides,
45
+ givenOverrides,
46
+ whenOverrides,
47
+ thenOverrides,
48
+ checkOverrides,
49
+ testResourceRequirement,
50
+ testSpecification
51
+ );
52
+ this.summary = {};
53
+ this.summary = {};
54
+ }
55
+ /**
56
+ * Simplified version for testing that doesn't actually run tests
57
+ */
58
+ testRun(puppetMaster) {
59
+ this.summary = {
60
+ [puppetMaster.testResourceConfiguration.name]: {
61
+ typeErrors: 0,
62
+ staticErrors: 0,
63
+ runTimeError: "",
64
+ prompt: "",
65
+ failingFeatures: {}
66
+ }
67
+ };
68
+ return Promise.resolve({
69
+ failed: false,
70
+ fails: 0,
71
+ artifacts: [],
72
+ logPromise: Promise.resolve(),
73
+ features: []
74
+ });
75
+ }
76
+ };
77
+
78
+ // src/lib/baseBuilder.test/baseBuilder.test.implementation.ts
79
+ var implementation = {
80
+ suites: {
81
+ Default: "BaseBuilder test suite"
82
+ },
83
+ givens: {
84
+ Default: () => {
85
+ return new TestBaseBuilder(
86
+ {},
87
+ {},
88
+ {},
89
+ {},
90
+ {},
91
+ {},
92
+ { ports: [] },
93
+ () => []
94
+ );
95
+ },
96
+ WithCustomInput: (input) => {
97
+ return new TestBaseBuilder(
98
+ input,
99
+ {},
100
+ {},
101
+ {},
102
+ {},
103
+ {},
104
+ { ports: [] },
105
+ () => []
106
+ );
107
+ },
108
+ WithResourceRequirements: (requirements) => {
109
+ return new TestBaseBuilder(
110
+ {},
111
+ {},
112
+ {},
113
+ {},
114
+ {},
115
+ {},
116
+ requirements,
117
+ () => []
118
+ );
119
+ }
120
+ },
121
+ whens: {
122
+ addArtifact: (artifact) => (builder) => {
123
+ builder.artifacts.push(artifact);
124
+ return builder;
125
+ },
126
+ setTestJobs: (jobs) => (builder) => {
127
+ builder.testJobs = jobs;
128
+ return builder;
129
+ }
130
+ },
131
+ thens: {
132
+ initializedProperly: () => (builder) => {
133
+ if (!(builder instanceof BaseBuilder)) {
134
+ throw new Error("Builder was not properly initialized");
135
+ }
136
+ return builder;
137
+ },
138
+ specsGenerated: () => (builder) => {
139
+ if (!Array.isArray(builder.specs)) {
140
+ throw new Error("Specs were not generated");
141
+ }
142
+ return builder;
143
+ },
144
+ jobsCreated: () => (builder) => {
145
+ if (!Array.isArray(builder.testJobs)) {
146
+ throw new Error("Test jobs were not created");
147
+ }
148
+ return builder;
149
+ },
150
+ artifactsTracked: () => (builder) => {
151
+ if (!Array.isArray(builder.artifacts)) {
152
+ throw new Error("Artifacts array not initialized");
153
+ }
154
+ return builder;
155
+ },
156
+ resourceRequirementsSet: () => (builder) => {
157
+ if (!builder.testResourceRequirement) {
158
+ throw new Error("Resource requirements not set");
159
+ }
160
+ return builder;
161
+ },
162
+ suitesOverridesConfigured: () => (builder) => {
163
+ if (!builder.suitesOverrides) {
164
+ throw new Error("Suites overrides not configured");
165
+ }
166
+ return builder;
167
+ },
168
+ givensOverridesConfigured: () => (builder) => {
169
+ if (!builder.givenOverides) {
170
+ throw new Error("Givens overrides not configured");
171
+ }
172
+ return builder;
173
+ },
174
+ whensOverridesConfigured: () => (builder) => {
175
+ if (!builder.whenOverides) {
176
+ throw new Error("Whens overrides not configured");
177
+ }
178
+ return builder;
179
+ },
180
+ thensOverridesConfigured: () => (builder) => {
181
+ if (!builder.thenOverides) {
182
+ throw new Error("Thens overrides not configured");
183
+ }
184
+ return builder;
185
+ },
186
+ checksOverridesConfigured: () => (builder) => {
187
+ if (!builder.checkOverides) {
188
+ throw new Error("Checks overrides not configured");
189
+ }
190
+ return builder;
191
+ }
192
+ },
193
+ checks: {
194
+ Default: () => new PassThrough()
195
+ // Not used in these tests
196
+ }
197
+ };
198
+
199
+ // src/lib/baseBuilder.test/baseBuilder.test.interface.ts
200
+ var testInterface = {
201
+ beforeEach: async (subject, initializer) => {
202
+ return initializer();
203
+ },
204
+ andWhen: async (store, whenCB, testResource, utils) => {
205
+ return whenCB(store, utils);
206
+ },
207
+ butThen: async (store, thenCB, testResource, pm) => {
208
+ return thenCB(store, pm);
209
+ },
210
+ afterEach: (store) => store,
211
+ afterAll: () => {
212
+ },
213
+ assertThis: (x) => {
214
+ }
215
+ };
216
+
217
+ // src/lib/baseBuilder.test/baseBuilder.test.ts
218
+ var baseBuilder_test_default = Node_default(
219
+ BaseBuilder.prototype,
220
+ specification,
221
+ implementation,
222
+ testInterface
223
+ );
224
+ export {
225
+ baseBuilder_test_default as default
226
+ };