testeranto 0.146.2 → 0.146.4

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 (197) hide show
  1. package/dist/common/src/Node.js +9 -6
  2. package/dist/common/src/PM/PM_WithEslintAndTsc.js +75 -58
  3. package/dist/common/src/PM/main.js +131 -79
  4. package/dist/common/src/PM/node.js +1 -14
  5. package/dist/common/src/PM/nodeSidecar.js +0 -1
  6. package/dist/common/src/Pure.js +17 -1
  7. package/dist/common/src/Pure.test.js +172 -0
  8. package/dist/common/src/build.js +0 -1
  9. package/dist/common/src/esbuildConfigs/consoleDetectorPlugin.js +22 -11
  10. package/dist/common/src/esbuildConfigs/nativeImportDetectorPlugin.js +24 -0
  11. package/dist/common/src/esbuildConfigs/pure.js +2 -1
  12. package/dist/common/src/esbuildConfigs/rebuildPlugin.js +1 -4
  13. package/dist/common/src/lib/BaseSuite.js +89 -0
  14. package/dist/common/src/lib/BaseSuite.test/node.test.js +9 -0
  15. package/dist/common/src/lib/BaseSuite.test/pure.test.js +9 -0
  16. package/dist/common/src/lib/BaseSuite.test/test.js +232 -0
  17. package/dist/common/src/lib/BaseSuite.test/web.test.js +9 -0
  18. package/dist/common/src/lib/abstractBase.js +1 -90
  19. package/dist/common/src/lib/abstractBase.test/MockGiven.js +17 -0
  20. package/dist/common/src/lib/abstractBase.test/MockThen.js +13 -0
  21. package/dist/common/src/lib/abstractBase.test/MockWhen.js +13 -0
  22. package/dist/common/src/lib/abstractBase.test/implementation.js +42 -0
  23. package/dist/common/src/lib/abstractBase.test/index.js +17 -0
  24. package/dist/common/src/lib/abstractBase.test/interface.js +12 -0
  25. package/dist/common/src/lib/abstractBase.test/specification.js +19 -0
  26. package/dist/common/src/lib/abstractBase.test/types.js +2 -0
  27. package/dist/common/src/lib/baseBuilder.test/TestBaseBuilder.js +36 -0
  28. package/dist/common/src/lib/baseBuilder.test/baseBuilder.test.implementation.js +97 -0
  29. package/dist/common/src/lib/baseBuilder.test/baseBuilder.test.interface.js +17 -0
  30. package/dist/common/src/lib/baseBuilder.test/baseBuilder.test.node.js +11 -0
  31. package/dist/common/src/lib/baseBuilder.test/baseBuilder.test.pure.js +11 -0
  32. package/dist/common/src/lib/baseBuilder.test/baseBuilder.test.specification.js +13 -0
  33. package/dist/common/src/lib/baseBuilder.test/baseBuilder.test.types.js +2 -0
  34. package/dist/common/src/lib/baseBuilder.test/baseBuilder.test.web.js +11 -0
  35. package/dist/common/src/lib/basebuilder.js +2 -1
  36. package/dist/common/src/lib/classBuilder.test/TestClassBuilder.js +41 -0
  37. package/dist/common/src/lib/classBuilder.test/classBuilder.test.implementation.js +182 -0
  38. package/dist/common/src/lib/classBuilder.test/classBuilder.test.interface.js +17 -0
  39. package/dist/common/src/lib/classBuilder.test/classBuilder.test.js +11 -0
  40. package/dist/common/src/lib/classBuilder.test/classBuilder.test.specification.js +41 -0
  41. package/dist/common/src/lib/classBuilder.test/classBuilder.test.types.js +2 -0
  42. package/dist/common/src/lib/core.js +4 -13
  43. package/dist/common/src/lib/core.test/MockCore.js +25 -0
  44. package/dist/common/src/lib/core.test/core.test.implementation.js +102 -0
  45. package/dist/common/src/lib/core.test/core.test.interface.js +18 -0
  46. package/dist/common/src/lib/core.test/core.test.js +17 -0
  47. package/dist/common/src/lib/core.test/core.test.specification.js +33 -0
  48. package/dist/common/src/lib/core.test/core.test.types.js +2 -0
  49. package/dist/common/src/lib/pmProxy.js +9 -166
  50. package/dist/common/src/lib/pmProxy.test/implementation.js +76 -0
  51. package/dist/common/src/lib/pmProxy.test/index.js +15 -0
  52. package/dist/common/src/lib/pmProxy.test/interface.js +37 -0
  53. package/dist/common/src/lib/pmProxy.test/mockPM.js +34 -0
  54. package/dist/common/src/lib/pmProxy.test/mockPMBase.js +115 -0
  55. package/dist/common/src/lib/pmProxy.test/specification.js +39 -0
  56. package/dist/common/src/lib/pmProxy.test/types.js +2 -0
  57. package/dist/common/src/run.js +6 -6
  58. package/dist/common/testeranto.config.js +33 -18
  59. package/dist/common/tsconfig.common.tsbuildinfo +1 -1
  60. package/dist/module/src/Node.js +9 -6
  61. package/dist/module/src/PM/PM_WithEslintAndTsc.js +75 -58
  62. package/dist/module/src/PM/main.js +131 -79
  63. package/dist/module/src/PM/node.js +1 -14
  64. package/dist/module/src/PM/nodeSidecar.js +0 -1
  65. package/dist/module/src/Pure.js +17 -1
  66. package/dist/module/src/Pure.test.js +167 -0
  67. package/dist/module/src/build.js +0 -1
  68. package/dist/module/src/esbuildConfigs/consoleDetectorPlugin.js +19 -11
  69. package/dist/module/src/esbuildConfigs/nativeImportDetectorPlugin.js +21 -0
  70. package/dist/module/src/esbuildConfigs/pure.js +2 -1
  71. package/dist/module/src/esbuildConfigs/rebuildPlugin.js +1 -4
  72. package/dist/module/src/lib/BaseSuite.js +85 -0
  73. package/dist/module/src/lib/BaseSuite.test/node.test.js +4 -0
  74. package/dist/module/src/lib/BaseSuite.test/pure.test.js +4 -0
  75. package/dist/module/src/lib/BaseSuite.test/test.js +227 -0
  76. package/dist/module/src/lib/BaseSuite.test/web.test.js +4 -0
  77. package/dist/module/src/lib/abstractBase.js +1 -89
  78. package/dist/module/src/lib/abstractBase.test/MockGiven.js +13 -0
  79. package/dist/module/src/lib/abstractBase.test/MockThen.js +9 -0
  80. package/dist/module/src/lib/abstractBase.test/MockWhen.js +9 -0
  81. package/dist/module/src/lib/abstractBase.test/implementation.js +39 -0
  82. package/dist/module/src/lib/abstractBase.test/index.js +12 -0
  83. package/dist/module/src/lib/abstractBase.test/interface.js +9 -0
  84. package/dist/module/src/lib/abstractBase.test/specification.js +15 -0
  85. package/dist/module/src/lib/abstractBase.test/types.js +1 -0
  86. package/dist/module/src/lib/baseBuilder.test/TestBaseBuilder.js +32 -0
  87. package/dist/module/src/lib/baseBuilder.test/baseBuilder.test.implementation.js +94 -0
  88. package/dist/module/src/lib/baseBuilder.test/baseBuilder.test.interface.js +14 -0
  89. package/dist/module/src/lib/baseBuilder.test/baseBuilder.test.node.js +6 -0
  90. package/dist/module/src/lib/baseBuilder.test/baseBuilder.test.pure.js +6 -0
  91. package/dist/module/src/lib/baseBuilder.test/baseBuilder.test.specification.js +9 -0
  92. package/dist/module/src/lib/baseBuilder.test/baseBuilder.test.types.js +1 -0
  93. package/dist/module/src/lib/baseBuilder.test/baseBuilder.test.web.js +6 -0
  94. package/dist/module/src/lib/basebuilder.js +2 -1
  95. package/dist/module/src/lib/classBuilder.test/TestClassBuilder.js +37 -0
  96. package/dist/module/src/lib/classBuilder.test/classBuilder.test.implementation.js +179 -0
  97. package/dist/module/src/lib/classBuilder.test/classBuilder.test.interface.js +14 -0
  98. package/dist/module/src/lib/classBuilder.test/classBuilder.test.js +6 -0
  99. package/dist/module/src/lib/classBuilder.test/classBuilder.test.specification.js +37 -0
  100. package/dist/module/src/lib/classBuilder.test/classBuilder.test.types.js +1 -0
  101. package/dist/module/src/lib/core.js +3 -12
  102. package/dist/module/src/lib/core.test/MockCore.js +18 -0
  103. package/dist/module/src/lib/core.test/core.test.implementation.js +99 -0
  104. package/dist/module/src/lib/core.test/core.test.interface.js +15 -0
  105. package/dist/module/src/lib/core.test/core.test.js +12 -0
  106. package/dist/module/src/lib/core.test/core.test.specification.js +29 -0
  107. package/dist/module/src/lib/core.test/core.test.types.js +1 -0
  108. package/dist/module/src/lib/pmProxy.js +9 -166
  109. package/dist/module/src/lib/pmProxy.test/implementation.js +73 -0
  110. package/dist/module/src/lib/pmProxy.test/index.js +10 -0
  111. package/dist/module/src/lib/pmProxy.test/interface.js +34 -0
  112. package/dist/module/src/lib/pmProxy.test/mockPM.js +30 -0
  113. package/dist/module/src/lib/pmProxy.test/mockPMBase.js +111 -0
  114. package/dist/module/src/lib/pmProxy.test/specification.js +35 -0
  115. package/dist/module/src/lib/pmProxy.test/types.js +1 -0
  116. package/dist/module/src/run.js +6 -6
  117. package/dist/module/testeranto.config.js +33 -18
  118. package/dist/module/tsconfig.module.tsbuildinfo +1 -1
  119. package/dist/prebuild/Project.js +16 -15
  120. package/dist/prebuild/TestReport.js +14 -12
  121. package/dist/prebuild/build.mjs +34 -34
  122. package/dist/prebuild/run.mjs +259 -173
  123. package/dist/tsconfig.tsbuildinfo +1 -1
  124. package/dist/types/src/PM/PM_WithEslintAndTsc.d.ts +2 -1
  125. package/dist/types/src/PM/main.d.ts +5 -2
  126. package/dist/types/src/Pure.d.ts +2 -2
  127. package/dist/types/src/Pure.test.d.ts +36 -0
  128. package/dist/types/src/Types.d.ts +7 -6
  129. package/dist/types/src/Web.d.ts +1 -1
  130. package/dist/types/src/esbuildConfigs/consoleDetectorPlugin.d.ts +1 -1
  131. package/dist/types/src/esbuildConfigs/nativeImportDetectorPlugin.d.ts +2 -0
  132. package/dist/types/src/lib/BaseSuite.d.ts +39 -0
  133. package/dist/types/src/lib/BaseSuite.test/node.test.d.ts +3 -0
  134. package/dist/types/src/lib/BaseSuite.test/pure.test.d.ts +3 -0
  135. package/dist/types/src/lib/BaseSuite.test/test.d.ts +42 -0
  136. package/dist/types/src/lib/BaseSuite.test/web.test.d.ts +3 -0
  137. package/dist/types/src/lib/abstractBase.d.ts +1 -36
  138. package/dist/types/src/lib/abstractBase.test/MockGiven.d.ts +7 -0
  139. package/dist/types/src/lib/abstractBase.test/MockThen.d.ts +6 -0
  140. package/dist/types/src/lib/abstractBase.test/MockWhen.d.ts +6 -0
  141. package/dist/types/src/lib/abstractBase.test/implementation.d.ts +3 -0
  142. package/dist/types/src/lib/abstractBase.test/index.d.ts +3 -0
  143. package/dist/types/src/lib/abstractBase.test/interface.d.ts +3 -0
  144. package/dist/types/src/lib/abstractBase.test/specification.d.ts +3 -0
  145. package/dist/types/src/lib/abstractBase.test/types.d.ts +39 -0
  146. package/dist/types/src/lib/baseBuilder.test/TestBaseBuilder.d.ts +15 -0
  147. package/dist/types/src/lib/baseBuilder.test/baseBuilder.test.implementation.d.ts +3 -0
  148. package/dist/types/src/lib/baseBuilder.test/baseBuilder.test.interface.d.ts +3 -0
  149. package/dist/types/src/lib/baseBuilder.test/baseBuilder.test.node.d.ts +3 -0
  150. package/dist/types/src/lib/baseBuilder.test/baseBuilder.test.pure.d.ts +3 -0
  151. package/dist/types/src/lib/baseBuilder.test/baseBuilder.test.specification.d.ts +3 -0
  152. package/dist/types/src/lib/baseBuilder.test/baseBuilder.test.types.d.ts +20 -0
  153. package/dist/types/src/lib/baseBuilder.test/baseBuilder.test.web.d.ts +3 -0
  154. package/dist/types/src/lib/classBuilder.test/TestClassBuilder.d.ts +21 -0
  155. package/dist/types/src/lib/classBuilder.test/classBuilder.test.d.ts +3 -0
  156. package/dist/types/src/lib/classBuilder.test/classBuilder.test.implementation.d.ts +3 -0
  157. package/dist/types/src/lib/classBuilder.test/classBuilder.test.interface.d.ts +3 -0
  158. package/dist/types/src/lib/classBuilder.test/classBuilder.test.specification.d.ts +3 -0
  159. package/dist/types/src/lib/classBuilder.test/classBuilder.test.types.d.ts +56 -0
  160. package/dist/types/src/lib/core.d.ts +1 -1
  161. package/dist/types/src/lib/core.test/MockCore.d.ts +10 -0
  162. package/dist/types/src/lib/core.test/core.test.d.ts +3 -0
  163. package/dist/types/src/lib/core.test/core.test.implementation.d.ts +3 -0
  164. package/dist/types/src/lib/core.test/core.test.interface.d.ts +3 -0
  165. package/dist/types/src/lib/core.test/core.test.specification.d.ts +3 -0
  166. package/dist/types/src/lib/core.test/core.test.types.d.ts +46 -0
  167. package/dist/types/src/lib/index.d.ts +2 -1
  168. package/dist/types/src/lib/pmProxy.d.ts +11 -6
  169. package/dist/types/src/lib/pmProxy.test/implementation.d.ts +3 -0
  170. package/dist/types/src/lib/pmProxy.test/index.d.ts +7 -0
  171. package/dist/types/src/lib/pmProxy.test/interface.d.ts +3 -0
  172. package/dist/types/src/lib/pmProxy.test/mockPM.d.ts +10 -0
  173. package/dist/types/src/lib/pmProxy.test/mockPMBase.d.ts +39 -0
  174. package/dist/types/src/lib/pmProxy.test/specification.d.ts +3 -0
  175. package/dist/types/src/lib/pmProxy.test/types.d.ts +42 -0
  176. package/dist/types/src/lib/types.d.ts +2 -1
  177. package/dist/types/tsconfig.types.tsbuildinfo +1 -1
  178. package/docs.html +35 -33
  179. package/index.html +23 -30
  180. package/package.json +3 -2
  181. package/testeranto/index.html +1 -1
  182. package/testeranto/reports/allTests/index.html +1 -1
  183. package/testeranto/reports/allTests/src/Pure.test/pure/index.html +1 -1
  184. package/testeranto/reports/allTests/src/Pure.test/pure/logs.txt +2 -2
  185. package/testeranto/reports/allTests/src/lib/BaseSuite.test/node.test/node/index.html +1 -1
  186. package/testeranto/reports/allTests/src/lib/BaseSuite.test/pure.test/pure/index.html +1 -1
  187. package/testeranto/reports/allTests/src/lib/BaseSuite.test/pure.test/pure/logs.txt +2 -2
  188. package/testeranto/reports/allTests/src/lib/BaseSuite.test/web.test/web/index.html +1 -1
  189. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/index.html +1 -1
  190. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/index.html +1 -1
  191. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/index.html +1 -1
  192. package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/index.html +1 -1
  193. package/testeranto/reports/allTests/src/lib/core.test/core.test/node/index.html +1 -1
  194. package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/index.html +1 -1
  195. package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/logs.txt +3 -3
  196. package/testeranto.config.ts +1 -1
  197. package/tsc.log +36 -38
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
+ /* eslint-disable @typescript-eslint/no-unused-vars */
3
+ /* eslint-disable @typescript-eslint/no-explicit-any */
2
4
  Object.defineProperty(exports, "__esModule", { value: true });
3
5
  exports.afterAllProxy = exports.beforeAllProxy = exports.beforeEachProxy = exports.afterEachProxy = exports.andWhenProxy = exports.butThenProxy = void 0;
4
- const prxy = function (pm, mappings) {
6
+ const baseProxy = function (pm, mappings) {
5
7
  return new Proxy(pm, {
6
8
  get: (target, prop, receiver) => {
7
9
  for (const mapping of mappings) {
@@ -15,7 +17,7 @@ const prxy = function (pm, mappings) {
15
17
  },
16
18
  });
17
19
  };
18
- const butThenProxy = (pm, filepath) => prxy(pm, [
20
+ const butThenProxy = (pm, filepath) => baseProxy(pm, [
19
21
  [
20
22
  "screencast",
21
23
  (opts, p) => [
@@ -37,7 +39,7 @@ const butThenProxy = (pm, filepath) => prxy(pm, [
37
39
  ],
38
40
  ]);
39
41
  exports.butThenProxy = butThenProxy;
40
- const andWhenProxy = (pm, filepath) => prxy(pm, [
42
+ const andWhenProxy = (pm, filepath) => baseProxy(pm, [
41
43
  [
42
44
  "screencast",
43
45
  (opts, p) => [
@@ -56,7 +58,7 @@ const andWhenProxy = (pm, filepath) => prxy(pm, [
56
58
  ],
57
59
  ]);
58
60
  exports.andWhenProxy = andWhenProxy;
59
- const afterEachProxy = (pm, suite, given) => prxy(pm, [
61
+ const afterEachProxy = (pm, suite, given) => baseProxy(pm, [
60
62
  [
61
63
  "screencast",
62
64
  (opts, p) => [
@@ -81,7 +83,7 @@ const afterEachProxy = (pm, suite, given) => prxy(pm, [
81
83
  ],
82
84
  ]);
83
85
  exports.afterEachProxy = afterEachProxy;
84
- const beforeEachProxy = (pm, suite) => prxy(pm, [
86
+ const beforeEachProxy = (pm, suite) => baseProxy(pm, [
85
87
  [
86
88
  "screencast",
87
89
  (opts, p) => [
@@ -103,7 +105,7 @@ const beforeEachProxy = (pm, suite) => prxy(pm, [
103
105
  ["createWriteStream", (fp) => [`suite-${suite}/beforeEach/${fp}`]],
104
106
  ]);
105
107
  exports.beforeEachProxy = beforeEachProxy;
106
- const beforeAllProxy = (pm, suite) => prxy(pm, [
108
+ const beforeAllProxy = (pm, suite) => baseProxy(pm, [
107
109
  [
108
110
  "writeFileSync",
109
111
  (fp, contents) => [`suite-${suite}/beforeAll/${fp}`, contents],
@@ -118,7 +120,7 @@ const beforeAllProxy = (pm, suite) => prxy(pm, [
118
120
  ["createWriteStream", (fp) => [`suite-${suite}/beforeAll/${fp}`]],
119
121
  ]);
120
122
  exports.beforeAllProxy = beforeAllProxy;
121
- const afterAllProxy = (pm, suite) => prxy(pm, [
123
+ const afterAllProxy = (pm, suite) => baseProxy(pm, [
122
124
  ["createWriteStream", (fp) => [`suite-${suite}/afterAll/${fp}`]],
123
125
  [
124
126
  "writeFileSync",
@@ -133,162 +135,3 @@ const afterAllProxy = (pm, suite) => prxy(pm, [
133
135
  ],
134
136
  ]);
135
137
  exports.afterAllProxy = afterAllProxy;
136
- /////////////////////////////////////////////////
137
- // export const butThenProxy = (pm: IPM, filepath: string) => {
138
- // return new Proxy(pm, {
139
- // get: (target, prop, receiver) => {
140
- // if (prop === "customScreenShot") {
141
- // return (opts, p) =>
142
- // target.customScreenShot(
143
- // {
144
- // ...opts,
145
- // path: `${filepath}/${opts.path}`,
146
- // },
147
- // p
148
- // );
149
- // }
150
- // if (prop === "writeFileSync") {
151
- // return (fp, contents) => target[prop](`${filepath}/${fp}`, contents);
152
- // }
153
- // },
154
- // });
155
- // };
156
- // export const andWhenProxy = (pm: IPM, filepath: string) => {
157
- // return new Proxy(pm, {
158
- // get(target, prop, receiver) {
159
- // if (prop === "customScreenShot") {
160
- // return (opts, p) =>
161
- // target.customScreenShot(
162
- // {
163
- // ...opts,
164
- // path: `${filepath}/${opts.path}`,
165
- // },
166
- // p
167
- // );
168
- // }
169
- // if (prop === "writeFileSync") {
170
- // return (fp, contents) =>
171
- // target[prop](`${filepath}/andWhen/${fp}`, contents);
172
- // }
173
- // /* @ts-ignore:next-line */
174
- // return Reflect.get(...arguments);
175
- // },
176
- // });
177
- // };
178
- // export const afterEachProxy = (pm: IPM, suite: string, given: string): IPM => {
179
- // return new Proxy(pm, {
180
- // get(target, prop, receiver) {
181
- // if (prop === "customScreenShot") {
182
- // return (opts, p) =>
183
- // target.customScreenShot(
184
- // {
185
- // ...opts,
186
- // path: `suite-${suite}/given-${given}/afterEach/${opts.path}`,
187
- // },
188
- // p
189
- // );
190
- // }
191
- // if (prop === "writeFileSync") {
192
- // return (fp, contents) =>
193
- // target[prop](
194
- // `suite-${suite}/given-${given}/afterEach/${fp}`,
195
- // contents
196
- // );
197
- // }
198
- // /* @ts-ignore:next-line */
199
- // return Reflect.get(...arguments);
200
- // },
201
- // });
202
- // };
203
- // export const beforeAllProxy = (pm: IPM, suite: string): IPM => {
204
- // return new Proxy(pm, {
205
- // get(target, prop, receiver) {
206
- // if (prop === "customScreenShot") {
207
- // return (opts, p) =>
208
- // target.customScreenShot(
209
- // {
210
- // ...opts,
211
- // // path: `${filepath}/${opts.path}`,
212
- // path: `suite-${suite}/beforeAll/${opts.path}`,
213
- // },
214
- // p
215
- // );
216
- // }
217
- // if (prop === "writeFileSync") {
218
- // return (fp, contents) =>
219
- // target[prop](`suite-${suite}/beforeAll/${fp}`, contents);
220
- // }
221
- // /* @ts-ignore:next-line */
222
- // return Reflect.get(...arguments);
223
- // },
224
- // });
225
- // };
226
- // export const beforeEachProxy = (pm: IPM, suite: string, given: string): IPM => {
227
- // return new Proxy(pm, {
228
- // get(target, prop, receiver) {
229
- // // if (prop === "write") {
230
- // // return (handle, contents) =>
231
- // // target[prop](
232
- // // `suite-${suiteNdx}/given-${key}/when/beforeEach/${fp}`,
233
- // // contents
234
- // // );
235
- // // }
236
- // if (prop === "createWriteStream") {
237
- // return (fp) =>
238
- // target[prop](`suite-${suite}/given-${given}/when/beforeEach/${fp}`);
239
- // }
240
- // if (prop === "writeFileSync") {
241
- // return (fp, contents) =>
242
- // target[prop](
243
- // `suite-${suite}/given-${given}/when/beforeEach/${fp}`,
244
- // contents
245
- // );
246
- // }
247
- // if (prop === "customScreenShot") {
248
- // return (opts, p) =>
249
- // target.customScreenShot(
250
- // {
251
- // ...opts,
252
- // path: `suite-${suite}/given-${given}/when/beforeEach/${opts.path}`,
253
- // },
254
- // p
255
- // );
256
- // }
257
- // if (prop === "screencast") {
258
- // return (opts, p) =>
259
- // target.screencast(
260
- // {
261
- // ...opts,
262
- // path: `suite-${suite}/given-${given}/when/beforeEach/${opts.path}`,
263
- // },
264
- // p
265
- // );
266
- // }
267
- // /* @ts-ignore:next-line */
268
- // return Reflect.get(...arguments);
269
- // },
270
- // });
271
- // };
272
- // export const afterAllProxy = (pm: IPM, suite: string): IPM => {
273
- // return new Proxy(pm, {
274
- // get(target, prop, receiver) {
275
- // if (prop === "customScreenShot") {
276
- // return (opts, p) =>
277
- // target.customScreenShot(
278
- // {
279
- // ...opts,
280
- // // path: `${filepath}/${opts.path}`,
281
- // path: `suite-${suite}/afterAll/${opts.path}`,
282
- // },
283
- // p
284
- // );
285
- // }
286
- // if (prop === "writeFileSync") {
287
- // return (fp, contents) =>
288
- // target[prop](`suite-${suite}/afterAll/${fp}`, contents);
289
- // }
290
- // /* @ts-ignore:next-line */
291
- // return Reflect.get(...arguments);
292
- // },
293
- // });
294
- // };
@@ -0,0 +1,76 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.implementation = void 0;
4
+ const mockPMBase_1 = require("./mockPMBase");
5
+ exports.implementation = {
6
+ suites: {
7
+ Default: "PM Proxy Tests",
8
+ },
9
+ givens: {
10
+ SomeBaseString: (s) => s,
11
+ },
12
+ whens: {
13
+ // functions have no mutations
14
+ },
15
+ thens: {
16
+ theButTheProxyReturns: (method, expectedPath) => (store) => {
17
+ var _a, _b, _c, _d, _e, _f, _g, _h;
18
+ const mockPm = new mockPMBase_1.MockPMBase();
19
+ const filepath = "test/path";
20
+ const proxiedPm = store.butThenProxy(mockPm, filepath);
21
+ let actualPath;
22
+ let actualContent;
23
+ try {
24
+ switch (method) {
25
+ case "writeFileSync":
26
+ const content = expectedPath.includes('content') ?
27
+ "test content" : "default content";
28
+ proxiedPm.writeFileSync(expectedPath.includes('empty') ? "" :
29
+ expectedPath.includes('nested') ? "nested/folder/test.txt" :
30
+ expectedPath.includes('spaces') ? "file with spaces.txt" :
31
+ expectedPath.includes('invalid') ? "../invalid.txt" :
32
+ "test.txt", content);
33
+ actualPath = (_a = mockPm.getLastCall("writeFileSync")) === null || _a === void 0 ? void 0 : _a.path;
34
+ actualContent = (_b = mockPm.getLastCall("writeFileSync")) === null || _b === void 0 ? void 0 : _b.content;
35
+ break;
36
+ case "createWriteStream":
37
+ proxiedPm.createWriteStream(expectedPath.includes('empty') ? "" : "stream.txt");
38
+ actualPath = (_c = mockPm.getLastCall("createWriteStream")) === null || _c === void 0 ? void 0 : _c.path;
39
+ break;
40
+ case "screencast":
41
+ proxiedPm.screencast({
42
+ path: "screen.png",
43
+ quality: 80,
44
+ fullPage: true
45
+ }, "test");
46
+ actualPath = (_e = (_d = mockPm.getLastCall("screencast")) === null || _d === void 0 ? void 0 : _d.opts) === null || _e === void 0 ? void 0 : _e.path;
47
+ actualContent = (_f = mockPm.getLastCall("screencast")) === null || _f === void 0 ? void 0 : _f.opts;
48
+ break;
49
+ case "customScreenShot":
50
+ proxiedPm.customScreenShot({ path: "shot.png" }, "test");
51
+ actualPath = (_h = (_g = mockPm.getLastCall("customScreenShot")) === null || _g === void 0 ? void 0 : _g.opts) === null || _h === void 0 ? void 0 : _h.path;
52
+ break;
53
+ default:
54
+ throw new Error(`Unknown method: ${method}`);
55
+ }
56
+ if (expectedPath === undefined) {
57
+ return [undefined, undefined];
58
+ }
59
+ return [actualPath, expectedPath, actualContent];
60
+ }
61
+ catch (error) {
62
+ return [error.message, expectedPath];
63
+ }
64
+ },
65
+ verifyContent: (expectedContent) => (result) => {
66
+ const actualContent = result[2];
67
+ if (JSON.stringify(actualContent) !== JSON.stringify(expectedContent)) {
68
+ throw new Error(`Content mismatch. Expected: ${JSON.stringify(expectedContent)}, Got: ${JSON.stringify(actualContent)}`);
69
+ }
70
+ return result;
71
+ },
72
+ },
73
+ checks: {
74
+ Default: (s) => s,
75
+ },
76
+ };
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const Node_1 = __importDefault(require("../../Node"));
7
+ const implementation_1 = require("./implementation");
8
+ const specification_1 = require("./specification");
9
+ const interface_1 = require("./interface");
10
+ const pmProxy_1 = require("../pmProxy");
11
+ exports.default = (0, Node_1.default)(
12
+ // because of the nature of testeranto, we must add all the testable items here
13
+ {
14
+ butThenProxy: pmProxy_1.butThenProxy,
15
+ }, specification_1.specification, implementation_1.implementation, interface_1.testInterface);
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.testInterface = void 0;
4
+ const chai_1 = require("chai");
5
+ const pmProxy_1 = require("../pmProxy");
6
+ const mockPMBase_1 = require("./mockPMBase");
7
+ // import { butThenProxy, andWhenProxy, beforeEachProxy } from "../pmProxy";
8
+ exports.testInterface = {
9
+ beforeEach: async (subject, initializer, testResource, initialValues, pm) => {
10
+ return subject;
11
+ // const mockPM = MockPMBase();
12
+ // return {
13
+ // beforeEachProxy: subject.butThenProxy(
14
+ // new MockPMBase() as unknown as IPM,
15
+ // initializer
16
+ // ),
17
+ // };
18
+ },
19
+ andWhen: async (store, whenCB, testResource, pm) => {
20
+ const proxiedPM = (0, pmProxy_1.andWhenProxy)(pm, "some/path");
21
+ return whenCB(store, proxiedPM);
22
+ },
23
+ butThen: async (store, thenCB, testResource, pm) => {
24
+ const proxiedPM = (0, pmProxy_1.butThenProxy)(pm, "some/path");
25
+ return thenCB(store, proxiedPM);
26
+ },
27
+ afterEach: async (store, key, pm) => store,
28
+ afterAll: async (store, pm) => { },
29
+ beforeAll: async (input, testResource, pm, theGivenString) => {
30
+ return {
31
+ beforeEachProxy: input.butThenProxy(new mockPMBase_1.MockPMBase(), theGivenString),
32
+ };
33
+ },
34
+ assertThis: (returnedFilePath, expectation) => {
35
+ chai_1.assert.equal(returnedFilePath, expectation);
36
+ },
37
+ };
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MockPM = void 0;
4
+ const mockPMBase_1 = require("./mockPMBase");
5
+ class MockPM extends mockPMBase_1.MockPMBase {
6
+ constructor(configs) {
7
+ super(configs);
8
+ this.server = {};
9
+ this.testResourceConfiguration = {};
10
+ }
11
+ // PM-specific methods
12
+ start() {
13
+ this.trackCall("start", {});
14
+ return Promise.resolve();
15
+ }
16
+ stop() {
17
+ this.trackCall("stop", {});
18
+ return Promise.resolve();
19
+ }
20
+ launchSideCar(n) {
21
+ this.trackCall("launchSideCar", { n });
22
+ return Promise.resolve([n, this.testResourceConfiguration]);
23
+ }
24
+ stopSideCar(n) {
25
+ this.trackCall("stopSideCar", { n });
26
+ return Promise.resolve();
27
+ }
28
+ // Override any methods that need different behavior from MockPMBase
29
+ // For example:
30
+ writeFileSync(path, content) {
31
+ return super.writeFileSync(path, content, "default-test-name");
32
+ }
33
+ }
34
+ exports.MockPM = MockPM;
@@ -0,0 +1,115 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MockPMBase = void 0;
4
+ class MockPMBase {
5
+ constructor(configs) {
6
+ this.calls = {};
7
+ this.testResourceConfiguration = {};
8
+ this.configs = configs || {};
9
+ }
10
+ // Common tracking functionality
11
+ trackCall(method, args) {
12
+ if (!this.calls[method]) {
13
+ this.calls[method] = [];
14
+ }
15
+ this.calls[method].push(args);
16
+ }
17
+ getCallCount(method) {
18
+ var _a;
19
+ return ((_a = this.calls[method]) === null || _a === void 0 ? void 0 : _a.length) || 0;
20
+ }
21
+ getLastCall(method) {
22
+ const calls = this.calls[method];
23
+ return calls ? calls[calls.length - 1] : null;
24
+ }
25
+ // Minimal implementations of required methods
26
+ launchSideCar(n, testName, projectName) {
27
+ this.trackCall("launchSideCar", { n, testName, projectName });
28
+ return Promise.resolve();
29
+ }
30
+ end(uid) {
31
+ this.trackCall("end", { uid });
32
+ return Promise.resolve(true);
33
+ }
34
+ writeFileSync(path, content, testName) {
35
+ this.trackCall("writeFileSync", { path, content, testName });
36
+ return Promise.resolve(true);
37
+ }
38
+ createWriteStream(path, testName) {
39
+ this.trackCall("createWriteStream", { path, testName });
40
+ return Promise.resolve(0);
41
+ }
42
+ screencast(opts, testName, page) {
43
+ this.trackCall("screencast", { opts, testName, page });
44
+ return Promise.resolve({});
45
+ }
46
+ customScreenShot(opts, testName, pageUid) {
47
+ this.trackCall("customScreenShot", { opts, testName, pageUid });
48
+ return Promise.resolve({});
49
+ }
50
+ testArtiFactoryfileWriter(tLog, callback) {
51
+ return (fPath, value) => {
52
+ this.trackCall("testArtiFactoryfileWriter", { fPath, value });
53
+ callback(Promise.resolve());
54
+ };
55
+ }
56
+ // Other required PM_Base methods with minimal implementations
57
+ closePage(p) {
58
+ return Promise.resolve();
59
+ }
60
+ $(selector, p) {
61
+ return Promise.resolve();
62
+ }
63
+ click(selector, page) {
64
+ return Promise.resolve();
65
+ }
66
+ goto(p, url) {
67
+ return Promise.resolve();
68
+ }
69
+ newPage() {
70
+ return Promise.resolve("mock-page");
71
+ }
72
+ pages() {
73
+ return Promise.resolve(["mock-page"]);
74
+ }
75
+ waitForSelector(p, s) {
76
+ return Promise.resolve(true);
77
+ }
78
+ focusOn(selector, p) {
79
+ return Promise.resolve();
80
+ }
81
+ typeInto(value, p) {
82
+ return Promise.resolve();
83
+ }
84
+ getAttribute(selector, attribute, p) {
85
+ return Promise.resolve();
86
+ }
87
+ getInnerHtml(selector, p) {
88
+ return Promise.resolve();
89
+ }
90
+ isDisabled(selector, p) {
91
+ return Promise.resolve(false);
92
+ }
93
+ screencastStop(s) {
94
+ return Promise.resolve();
95
+ }
96
+ existsSync(destFolder) {
97
+ return false;
98
+ }
99
+ mkdirSync(fp) {
100
+ return Promise.resolve();
101
+ }
102
+ write(uid, contents) {
103
+ return Promise.resolve(true);
104
+ }
105
+ page(p) {
106
+ return "mock-page";
107
+ }
108
+ doInPage(p, cb) {
109
+ return Promise.resolve();
110
+ }
111
+ customclose() {
112
+ return Promise.resolve();
113
+ }
114
+ }
115
+ exports.MockPMBase = MockPMBase;
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.specification = void 0;
4
+ const specification = (Suite, Given, When, Then, Check) => [
5
+ Suite.Default("PM Proxy Functionality", {
6
+ // Basic path rewriting tests
7
+ writeFileProxyTest: Given.SomeBaseString(["butThenProxy should rewrite writeFileSync paths"], [], [Then.theButTheProxyReturns("writeFileSync", "test/path/butThen/test.txt")], "writeFileSync test"),
8
+ createWriteStreamProxyTest: Given.SomeBaseString(["butThenProxy should rewrite createWriteStream paths"], [], [Then.theButTheProxyReturns("createWriteStream", "test/path/butThen/stream.txt")], "createWriteStream test"),
9
+ screencastProxyTest: Given.SomeBaseString(["butThenProxy should rewrite screencast paths"], [], [Then.theButTheProxyReturns("screencast", "test/path/butThen/screen.png")], "screencast test"),
10
+ customScreenShotProxyTest: Given.SomeBaseString(["butThenProxy should rewrite customScreenShot paths"], [], [Then.theButTheProxyReturns("customScreenShot", "test/path/butThen/shot.png")], "customScreenShot test"),
11
+ // Edge cases
12
+ emptyPathTest: Given.SomeBaseString(["butThenProxy should handle empty paths"], [], [Then.theButTheProxyReturns("writeFileSync", "test/path/butThen/")], "empty path test"),
13
+ nestedPathTest: Given.SomeBaseString(["butThenProxy should handle nested paths"], [], [Then.theButTheProxyReturns("writeFileSync", "test/path/butThen/nested/folder/test.txt")], "nested path test"),
14
+ specialCharsTest: Given.SomeBaseString(["butThenProxy should handle special characters in paths"], [], [Then.theButTheProxyReturns("writeFileSync", "test/path/butThen/file with spaces.txt")], "special chars test"),
15
+ }),
16
+ Suite.Default("Proxy Type Coverage", {
17
+ // Test all proxy types
18
+ butThenProxyTest: Given.SomeBaseString(["butThenProxy should work correctly"], [], [Then.theButTheProxyReturns("writeFileSync", "test/path/butThen/test.txt")], "butThenProxy test"),
19
+ andWhenProxyTest: Given.SomeBaseString(["andWhenProxy should work correctly"], [], [Then.theButTheProxyReturns("writeFileSync", "test/path/andWhen/test.txt")], "andWhenProxy test"),
20
+ beforeEachProxyTest: Given.SomeBaseString(["beforeEachProxy should work correctly"], [], [Then.theButTheProxyReturns("writeFileSync", "suite-1/beforeEach/test.txt")], "beforeEachProxy test"),
21
+ afterEachProxyTest: Given.SomeBaseString(["afterEachProxy should work correctly"], [], [Then.theButTheProxyReturns("writeFileSync", "suite-1/given-1/afterEach/test.txt")], "afterEachProxy test"),
22
+ }),
23
+ Suite.Default("Content Preservation", {
24
+ // Verify content is preserved
25
+ contentPreservationTest: Given.SomeBaseString(["Proxies should preserve file content"], [], [
26
+ Then.theButTheProxyReturns("writeFileSync", "test/path/butThen/test.txt"),
27
+ Then.verifyContent("test content")
28
+ ], "content preservation test"),
29
+ objectContentTest: Given.SomeBaseString(["Proxies should preserve object content"], [], [
30
+ Then.theButTheProxyReturns("screencast", "test/path/butThen/screen.png"),
31
+ Then.verifyContent({ quality: 80, fullPage: true })
32
+ ], "object content test"),
33
+ }),
34
+ Suite.Default("Error Cases", {
35
+ invalidPathTest: Given.SomeBaseString(["Proxies should handle invalid paths"], [], [Then.theButTheProxyReturns("writeFileSync", "test/path/butThen/../invalid.txt")], "invalid path test"),
36
+ undefinedInputTest: Given.SomeBaseString(["Proxies should handle undefined inputs"], [], [Then.theButTheProxyReturns("writeFileSync", undefined)], "undefined input test"),
37
+ }),
38
+ ];
39
+ exports.specification = specification;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -42,25 +42,25 @@ const main_1 = require("./PM/main");
42
42
  readline_1.default.emitKeypressEvents(process.stdin);
43
43
  if (process.stdin.isTTY)
44
44
  process.stdin.setRawMode(true);
45
- console.log(ansi_colors_1.default.inverse("Press 'x' to shutdown forcefully."));
45
+ console.log(ansi_colors_1.default.inverse("Press 'q' to initiate a graceful shutdown."));
46
+ console.log(ansi_colors_1.default.inverse("Press 'x' to quit forcefully."));
46
47
  process.stdin.on("keypress", (str, key) => {
47
48
  if (key.name === "x") {
48
49
  console.log(ansi_colors_1.default.inverse("Shutting down forcefully..."));
49
50
  process.exit(-1);
50
51
  }
51
52
  });
52
- const testName = process.argv[2];
53
+ const projectName = process.argv[2];
53
54
  const mode = process.argv[3];
54
55
  if (mode !== "once" && mode !== "dev") {
55
56
  console.error("the 2nd argument should be 'dev' or 'once' ");
56
57
  process.exit(-1);
57
58
  }
58
- console.log("testeranto is running", testName, mode);
59
59
  Promise.resolve(`${process.cwd() + "/" + "testeranto.config.ts"}`).then(s => __importStar(require(s))).then(async (module) => {
60
60
  const bigConfig = module.default;
61
- const rawConfig = bigConfig.projects[testName];
62
- const config = Object.assign(Object.assign({}, rawConfig), { buildDir: process.cwd() + "/" + `testeranto/${testName}.json` });
63
- const pm = new main_1.PM_Main(config, testName, mode);
61
+ const rawConfig = bigConfig.projects[projectName];
62
+ const config = Object.assign(Object.assign({}, rawConfig), { buildDir: process.cwd() + "/" + `testeranto/${projectName}.json` });
63
+ const pm = new main_1.PM_Main(config, projectName, mode);
64
64
  pm.start();
65
65
  process.stdin.on("keypress", (str, key) => {
66
66
  if (key.name === "q") {
@@ -1,43 +1,58 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- // import redux from "testeranto_with_reduxjs_toolkit/testeranto.config";
4
- // import solidity from "testeranto-solidity/testeranto.config";
5
3
  const config = {
6
4
  projects: {
7
- // redux: {
8
- // ...redux.projects.allTests,
9
- // src: "node_modules/testeranto_with_reduxjs_toolkit",
10
- // },
11
- // solidity: {
12
- // ...solidity.projects.solidity,
13
- // src: "node_modules/testeranto-solidity",
14
- // },
15
- mothership: {
5
+ allTests: {
16
6
  tests: [
17
- // ["./src/mothership/test.ts", "node", { ports: 1 }, []],
7
+ ["src/lib/BaseSuite.test/node.test.ts", "node", { ports: 0 }, []],
8
+ ["src/lib/BaseSuite.test/pure.test.ts", "pure", { ports: 0 }, []],
9
+ ["src/lib/BaseSuite.test/web.test.ts", "web", { ports: 0 }, []],
10
+ ["src/Pure.test.ts", "pure", { ports: 0 }, []],
11
+ ["src/lib/pmProxy.test/index.ts", "node", { ports: 0 }, []],
12
+ ["src/lib/core.test/core.test.ts", "node", { ports: 0 }, []],
18
13
  [
19
- "./src/PM/__tests__/nodeSidecar.testeranto.ts",
14
+ "src/lib/classBuilder.test/classBuilder.test.ts",
20
15
  "node",
21
- { ports: 1 },
16
+ { ports: 0 },
17
+ [],
18
+ ],
19
+ [
20
+ "src/lib/baseBuilder.test/baseBuilder.test.node.ts",
21
+ "node",
22
+ { ports: 0 },
23
+ [],
24
+ ],
25
+ [
26
+ "src/lib/baseBuilder.test/baseBuilder.test.pure.ts",
27
+ "pure",
28
+ { ports: 0 },
29
+ [],
30
+ ],
31
+ [
32
+ "src/lib/baseBuilder.test/baseBuilder.test.web.ts",
33
+ "web",
34
+ { ports: 0 },
22
35
  [],
23
36
  ],
37
+ // ["src/mothership/test.ts", "node", { ports: 0 }, []],
38
+ // ["./src/lib/abstractBase/index.ts", "node", { ports: 0 }, []],
24
39
  // [
25
- // "./src/PM/__tests__/pureSidecar.testeranto.ts",
40
+ // "src/PM/__tests__/nodeSidecar.testeranto.ts",
26
41
  // "node",
27
42
  // { ports: 1 },
28
43
  // [],
29
44
  // ],
30
45
  // [
31
- // "./src/PM/__tests__/webSidecar.testeranto.ts",
46
+ // "src/PM/__tests__/pureSidecar.testeranto.ts",
32
47
  // "node",
33
48
  // { ports: 1 },
34
49
  // [],
35
50
  // ],
51
+ // ["src/PM/__tests__/webSidecar.testeranto.ts", "node", { ports: 1 }, []],
36
52
  ],
37
53
  clearScreen: false,
38
54
  debugger: false,
39
55
  externals: [],
40
- externalTests: {},
41
56
  featureIngestor: function (s) {
42
57
  throw new Error("Function not implemented.");
43
58
  },
@@ -81,8 +96,8 @@ const config = {
81
96
  webPlugins: [],
82
97
  nodePlugins: [],
83
98
  importPlugins: [],
84
- externalTests: {},
85
99
  },
86
100
  },
101
+ reportDomain: "https://adamwong246.github.io/testeranto/testeranto",
87
102
  };
88
103
  exports.default = config;