testeranto 0.219.14 → 0.219.15

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 (237) hide show
  1. package/package.json +1 -1
  2. package/src/testeranto.ts +1 -1
  3. package/dist/common/allTestsUtils.js +0 -17
  4. package/dist/common/package.json +0 -3
  5. package/dist/common/scripts/build-example.js +0 -105
  6. package/dist/common/src/Init.js +0 -38
  7. package/dist/common/src/Types.js +0 -63
  8. package/dist/common/src/esbuildConfigs/consoleDetectorPlugin.js +0 -38
  9. package/dist/common/src/esbuildConfigs/eslint-formatter-testeranto.js +0 -21
  10. package/dist/common/src/esbuildConfigs/featuresPlugin.js +0 -39
  11. package/dist/common/src/esbuildConfigs/index.js +0 -22
  12. package/dist/common/src/esbuildConfigs/inputFilesPlugin.js +0 -30
  13. package/dist/common/src/esbuildConfigs/nativeImportDetectorPlugin.js +0 -24
  14. package/dist/common/src/esbuildConfigs/rebuildPlugin.js +0 -19
  15. package/dist/common/src/init-docs.js +0 -9
  16. package/dist/common/src/lib/tiposkripto/BaseGiven.js +0 -96
  17. package/dist/common/src/lib/tiposkripto/BaseSuite.js +0 -134
  18. package/dist/common/src/lib/tiposkripto/BaseThen.js +0 -65
  19. package/dist/common/src/lib/tiposkripto/BaseTiposkripto.js +0 -193
  20. package/dist/common/src/lib/tiposkripto/BaseWhen.js +0 -46
  21. package/dist/common/src/lib/tiposkripto/CoreTypes.js +0 -2
  22. package/dist/common/src/lib/tiposkripto/Node.js +0 -40
  23. package/dist/common/src/lib/tiposkripto/Tiposkripto.js +0 -49
  24. package/dist/common/src/lib/tiposkripto/Types.js +0 -2
  25. package/dist/common/src/lib/tiposkripto/Web.js +0 -70
  26. package/dist/common/src/lib/tiposkripto/abstractBase.test/MockGiven.js +0 -22
  27. package/dist/common/src/lib/tiposkripto/abstractBase.test/MockThen.js +0 -16
  28. package/dist/common/src/lib/tiposkripto/abstractBase.test/MockWhen.js +0 -18
  29. package/dist/common/src/lib/tiposkripto/abstractBase.test/adapter.js +0 -24
  30. package/dist/common/src/lib/tiposkripto/abstractBase.test/implementation.js +0 -38
  31. package/dist/common/src/lib/tiposkripto/abstractBase.test/index.js +0 -17
  32. package/dist/common/src/lib/tiposkripto/abstractBase.test/specification.js +0 -19
  33. package/dist/common/src/lib/tiposkripto/abstractBase.test/types.js +0 -2
  34. package/dist/common/src/lib/tiposkripto/index.js +0 -29
  35. package/dist/common/src/runtimes.js +0 -4
  36. package/dist/common/src/server/aider/configParser.js +0 -124
  37. package/dist/common/src/server/aider/docker.js +0 -30
  38. package/dist/common/src/server/getRunnables.js +0 -36
  39. package/dist/common/src/server/htmlTemplate.js +0 -44
  40. package/dist/common/src/server/nodeVersion.js +0 -5
  41. package/dist/common/src/server/runtimes/common.js +0 -136
  42. package/dist/common/src/server/runtimes/golang/docker.js +0 -62
  43. package/dist/common/src/server/runtimes/java/docker.js +0 -46
  44. package/dist/common/src/server/runtimes/node/docker.js +0 -42
  45. package/dist/common/src/server/runtimes/node/esbuild.js +0 -40
  46. package/dist/common/src/server/runtimes/node/node.js +0 -75
  47. package/dist/common/src/server/runtimes/python/docker.js +0 -31
  48. package/dist/common/src/server/runtimes/ruby/docker.js +0 -34
  49. package/dist/common/src/server/runtimes/rust/docker.js +0 -35
  50. package/dist/common/src/server/runtimes/web/docker.js +0 -42
  51. package/dist/common/src/server/runtimes/web/esbuild.js +0 -29
  52. package/dist/common/src/server/runtimes/web/hoist.js +0 -16
  53. package/dist/common/src/server/runtimes/web/web.js +0 -157
  54. package/dist/common/src/server/serverClasees/Server.js +0 -47
  55. package/dist/common/src/server/serverClasees/Server_Base.js +0 -18
  56. package/dist/common/src/server/serverClasees/Server_Docker.js +0 -904
  57. package/dist/common/src/server/serverClasees/Server_FS.js +0 -119
  58. package/dist/common/src/server/serverClasees/Server_HTTP.js +0 -189
  59. package/dist/common/src/server/serverClasees/Server_WS.js +0 -262
  60. package/dist/common/src/server/serverManagers/DockerManager.js +0 -28
  61. package/dist/common/src/server/serverManagers/HttpManager.js +0 -114
  62. package/dist/common/src/server/serverManagers/WsManager.js +0 -230
  63. package/dist/common/src/server/serverManagers/fs.js +0 -32
  64. package/dist/common/src/server/serverManagers/tcp.js +0 -51
  65. package/dist/common/src/server/types.js +0 -2
  66. package/dist/common/src/testeranto.js +0 -75
  67. package/dist/common/src/vscode/TerminalManager.js +0 -129
  68. package/dist/common/src/vscode/TestTreeItem.js +0 -77
  69. package/dist/common/src/vscode/extension.js +0 -185
  70. package/dist/common/src/vscode/providers/FeaturesTreeDataProvider.js +0 -445
  71. package/dist/common/src/vscode/providers/FileTreeDataProvider.js +0 -190
  72. package/dist/common/src/vscode/providers/ProcessesTreeDataProvider.js +0 -270
  73. package/dist/common/src/vscode/providers/ResultsTreeDataProvider.js +0 -87
  74. package/dist/common/src/vscode/providers/TestTreeDataProvider.js +0 -309
  75. package/dist/common/src/vscode/types.js +0 -9
  76. package/dist/common/testeranto/runtimes/node/node.js +0 -7
  77. package/dist/common/testeranto/runtimes/web/web.js +0 -6
  78. package/dist/common/testeranto/testeranto.js +0 -70
  79. package/dist/common/tsconfig.common.tsbuildinfo +0 -1
  80. package/dist/module/allTestsUtils.js +0 -13
  81. package/dist/module/package.json +0 -3
  82. package/dist/module/scripts/build-example.js +0 -100
  83. package/dist/module/src/Init.js +0 -33
  84. package/dist/module/src/Types.js +0 -62
  85. package/dist/module/src/esbuildConfigs/consoleDetectorPlugin.js +0 -32
  86. package/dist/module/src/esbuildConfigs/eslint-formatter-testeranto.js +0 -18
  87. package/dist/module/src/esbuildConfigs/featuresPlugin.js +0 -34
  88. package/dist/module/src/esbuildConfigs/index.js +0 -20
  89. package/dist/module/src/esbuildConfigs/inputFilesPlugin.js +0 -25
  90. package/dist/module/src/esbuildConfigs/nativeImportDetectorPlugin.js +0 -21
  91. package/dist/module/src/esbuildConfigs/rebuildPlugin.js +0 -14
  92. package/dist/module/src/init-docs.js +0 -4
  93. package/dist/module/src/lib/tiposkripto/BaseGiven.js +0 -92
  94. package/dist/module/src/lib/tiposkripto/BaseSuite.js +0 -130
  95. package/dist/module/src/lib/tiposkripto/BaseThen.js +0 -61
  96. package/dist/module/src/lib/tiposkripto/BaseTiposkripto.js +0 -190
  97. package/dist/module/src/lib/tiposkripto/BaseWhen.js +0 -42
  98. package/dist/module/src/lib/tiposkripto/CoreTypes.js +0 -1
  99. package/dist/module/src/lib/tiposkripto/Node.js +0 -33
  100. package/dist/module/src/lib/tiposkripto/Tiposkripto.js +0 -14
  101. package/dist/module/src/lib/tiposkripto/Types.js +0 -1
  102. package/dist/module/src/lib/tiposkripto/Web.js +0 -63
  103. package/dist/module/src/lib/tiposkripto/abstractBase.test/MockGiven.js +0 -18
  104. package/dist/module/src/lib/tiposkripto/abstractBase.test/MockThen.js +0 -12
  105. package/dist/module/src/lib/tiposkripto/abstractBase.test/MockWhen.js +0 -14
  106. package/dist/module/src/lib/tiposkripto/abstractBase.test/adapter.js +0 -21
  107. package/dist/module/src/lib/tiposkripto/abstractBase.test/implementation.js +0 -35
  108. package/dist/module/src/lib/tiposkripto/abstractBase.test/index.js +0 -12
  109. package/dist/module/src/lib/tiposkripto/abstractBase.test/specification.js +0 -15
  110. package/dist/module/src/lib/tiposkripto/abstractBase.test/types.js +0 -1
  111. package/dist/module/src/lib/tiposkripto/index.js +0 -24
  112. package/dist/module/src/runtimes.js +0 -1
  113. package/dist/module/src/server/aider/configParser.js +0 -116
  114. package/dist/module/src/server/aider/docker.js +0 -28
  115. package/dist/module/src/server/getRunnables.js +0 -29
  116. package/dist/module/src/server/htmlTemplate.js +0 -40
  117. package/dist/module/src/server/nodeVersion.js +0 -2
  118. package/dist/module/src/server/runtimes/common.js +0 -127
  119. package/dist/module/src/server/runtimes/golang/docker.js +0 -55
  120. package/dist/module/src/server/runtimes/java/docker.js +0 -40
  121. package/dist/module/src/server/runtimes/node/docker.js +0 -36
  122. package/dist/module/src/server/runtimes/node/esbuild.js +0 -35
  123. package/dist/module/src/server/runtimes/node/node.js +0 -37
  124. package/dist/module/src/server/runtimes/python/docker.js +0 -25
  125. package/dist/module/src/server/runtimes/ruby/docker.js +0 -28
  126. package/dist/module/src/server/runtimes/rust/docker.js +0 -29
  127. package/dist/module/src/server/runtimes/web/docker.js +0 -36
  128. package/dist/module/src/server/runtimes/web/esbuild.js +0 -24
  129. package/dist/module/src/server/runtimes/web/hoist.js +0 -11
  130. package/dist/module/src/server/runtimes/web/web.js +0 -119
  131. package/dist/module/src/server/serverClasees/Server.js +0 -40
  132. package/dist/module/src/server/serverClasees/Server_Base.js +0 -14
  133. package/dist/module/src/server/serverClasees/Server_Docker.js +0 -897
  134. package/dist/module/src/server/serverClasees/Server_FS.js +0 -119
  135. package/dist/module/src/server/serverClasees/Server_HTTP.js +0 -182
  136. package/dist/module/src/server/serverClasees/Server_WS.js +0 -258
  137. package/dist/module/src/server/serverManagers/DockerManager.js +0 -28
  138. package/dist/module/src/server/serverManagers/HttpManager.js +0 -110
  139. package/dist/module/src/server/serverManagers/WsManager.js +0 -226
  140. package/dist/module/src/server/serverManagers/fs.js +0 -32
  141. package/dist/module/src/server/serverManagers/tcp.js +0 -47
  142. package/dist/module/src/server/types.js +0 -1
  143. package/dist/module/src/testeranto.js +0 -40
  144. package/dist/module/src/vscode/TerminalManager.js +0 -92
  145. package/dist/module/src/vscode/TestTreeItem.js +0 -40
  146. package/dist/module/src/vscode/extension.js +0 -148
  147. package/dist/module/src/vscode/providers/FeaturesTreeDataProvider.js +0 -408
  148. package/dist/module/src/vscode/providers/FileTreeDataProvider.js +0 -153
  149. package/dist/module/src/vscode/providers/ProcessesTreeDataProvider.js +0 -233
  150. package/dist/module/src/vscode/providers/ResultsTreeDataProvider.js +0 -50
  151. package/dist/module/src/vscode/providers/TestTreeDataProvider.js +0 -272
  152. package/dist/module/src/vscode/types.js +0 -6
  153. package/dist/module/testeranto/runtimes/node/node.js +0 -5
  154. package/dist/module/testeranto/runtimes/web/web.js +0 -4
  155. package/dist/module/testeranto/testeranto.js +0 -68
  156. package/dist/module/tsconfig.module.tsbuildinfo +0 -1
  157. package/dist/prebuild/chunk-QLT7PNPK.mjs +0 -162
  158. package/dist/prebuild/esbuildConfigs/eslint-formatter-testeranto.mjs +0 -20
  159. package/dist/prebuild/init-docs.mjs +0 -56
  160. package/dist/prebuild/server/runtimes/node/node.mjs +0 -80
  161. package/dist/prebuild/server/runtimes/web/hoist.mjs +0 -12
  162. package/dist/prebuild/server/runtimes/web/web.mjs +0 -162
  163. package/dist/prebuild/testeranto-6SAYRVSE.mjs +0 -72
  164. package/dist/prebuild/testeranto.mjs +0 -1692
  165. package/dist/types/src/Init.d.ts +0 -2
  166. package/dist/types/src/Types.d.ts +0 -87
  167. package/dist/types/src/esbuildConfigs/consoleDetectorPlugin.d.ts +0 -2
  168. package/dist/types/src/esbuildConfigs/eslint-formatter-testeranto.d.ts +0 -2
  169. package/dist/types/src/esbuildConfigs/featuresPlugin.d.ts +0 -5
  170. package/dist/types/src/esbuildConfigs/index.d.ts +0 -3
  171. package/dist/types/src/esbuildConfigs/inputFilesPlugin.d.ts +0 -7
  172. package/dist/types/src/esbuildConfigs/nativeImportDetectorPlugin.d.ts +0 -2
  173. package/dist/types/src/esbuildConfigs/rebuildPlugin.d.ts +0 -6
  174. package/dist/types/src/init-docs.d.ts +0 -1
  175. package/dist/types/src/lib/tiposkripto/BaseGiven.d.ts +0 -42
  176. package/dist/types/src/lib/tiposkripto/BaseSuite.d.ts +0 -46
  177. package/dist/types/src/lib/tiposkripto/BaseThen.d.ts +0 -28
  178. package/dist/types/src/lib/tiposkripto/BaseTiposkripto.d.ts +0 -35
  179. package/dist/types/src/lib/tiposkripto/BaseWhen.d.ts +0 -27
  180. package/dist/types/src/lib/tiposkripto/CoreTypes.d.ts +0 -51
  181. package/dist/types/src/lib/tiposkripto/Node.d.ts +0 -9
  182. package/dist/types/src/lib/tiposkripto/Tiposkripto.d.ts +0 -5
  183. package/dist/types/src/lib/tiposkripto/Types.d.ts +0 -9
  184. package/dist/types/src/lib/tiposkripto/Web.d.ts +0 -9
  185. package/dist/types/src/lib/tiposkripto/abstractBase.test/MockGiven.d.ts +0 -9
  186. package/dist/types/src/lib/tiposkripto/abstractBase.test/MockThen.d.ts +0 -6
  187. package/dist/types/src/lib/tiposkripto/abstractBase.test/MockWhen.d.ts +0 -6
  188. package/dist/types/src/lib/tiposkripto/abstractBase.test/adapter.d.ts +0 -3
  189. package/dist/types/src/lib/tiposkripto/abstractBase.test/implementation.d.ts +0 -3
  190. package/dist/types/src/lib/tiposkripto/abstractBase.test/index.d.ts +0 -28
  191. package/dist/types/src/lib/tiposkripto/abstractBase.test/specification.d.ts +0 -3
  192. package/dist/types/src/lib/tiposkripto/abstractBase.test/types.d.ts +0 -39
  193. package/dist/types/src/lib/tiposkripto/index.d.ts +0 -56
  194. package/dist/types/src/runtimes.d.ts +0 -2
  195. package/dist/types/src/server/aider/configParser.d.ts +0 -11
  196. package/dist/types/src/server/aider/docker.d.ts +0 -2
  197. package/dist/types/src/server/getRunnables.d.ts +0 -3
  198. package/dist/types/src/server/htmlTemplate.d.ts +0 -2
  199. package/dist/types/src/server/nodeVersion.d.ts +0 -2
  200. package/dist/types/src/server/runtimes/common.d.ts +0 -12
  201. package/dist/types/src/server/runtimes/golang/docker.d.ts +0 -5
  202. package/dist/types/src/server/runtimes/java/docker.d.ts +0 -14
  203. package/dist/types/src/server/runtimes/node/docker.d.ts +0 -14
  204. package/dist/types/src/server/runtimes/node/esbuild.d.ts +0 -4
  205. package/dist/types/src/server/runtimes/node/node.d.ts +0 -1
  206. package/dist/types/src/server/runtimes/python/docker.d.ts +0 -14
  207. package/dist/types/src/server/runtimes/ruby/docker.d.ts +0 -14
  208. package/dist/types/src/server/runtimes/rust/docker.d.ts +0 -14
  209. package/dist/types/src/server/runtimes/web/docker.d.ts +0 -15
  210. package/dist/types/src/server/runtimes/web/esbuild.d.ts +0 -4
  211. package/dist/types/src/server/runtimes/web/hoist.d.ts +0 -1
  212. package/dist/types/src/server/runtimes/web/web.d.ts +0 -1
  213. package/dist/types/src/server/serverClasees/Server.d.ts +0 -8
  214. package/dist/types/src/server/serverClasees/Server_Base.d.ts +0 -9
  215. package/dist/types/src/server/serverClasees/Server_Docker.d.ts +0 -81
  216. package/dist/types/src/server/serverClasees/Server_FS.d.ts +0 -0
  217. package/dist/types/src/server/serverClasees/Server_HTTP.d.ts +0 -20
  218. package/dist/types/src/server/serverClasees/Server_WS.d.ts +0 -23
  219. package/dist/types/src/server/serverManagers/DockerManager.d.ts +0 -0
  220. package/dist/types/src/server/serverManagers/HttpManager.d.ts +0 -9
  221. package/dist/types/src/server/serverManagers/WsManager.d.ts +0 -10
  222. package/dist/types/src/server/serverManagers/fs.d.ts +0 -0
  223. package/dist/types/src/server/serverManagers/tcp.d.ts +0 -27
  224. package/dist/types/src/server/types.d.ts +0 -68
  225. package/dist/types/src/testeranto.d.ts +0 -1
  226. package/dist/types/src/vscode/TerminalManager.d.ts +0 -18
  227. package/dist/types/src/vscode/TestTreeItem.d.ts +0 -13
  228. package/dist/types/src/vscode/extension.d.ts +0 -3
  229. package/dist/types/src/vscode/providers/FeaturesTreeDataProvider.d.ts +0 -17
  230. package/dist/types/src/vscode/providers/FileTreeDataProvider.d.ts +0 -13
  231. package/dist/types/src/vscode/providers/ProcessesTreeDataProvider.d.ts +0 -23
  232. package/dist/types/src/vscode/providers/ResultsTreeDataProvider.d.ts +0 -10
  233. package/dist/types/src/vscode/providers/TestTreeDataProvider.d.ts +0 -16
  234. package/dist/types/src/vscode/types.d.ts +0 -14
  235. package/dist/types/testeranto/testeranto.d.ts +0 -3
  236. package/dist/types/tsconfig.types.tsbuildinfo +0 -1
  237. package/dist/vscode/extension.mjs +0 -5116
@@ -1,134 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BaseSuite = void 0;
4
- class BaseSuite {
5
- addArtifact(path) {
6
- if (typeof path !== "string") {
7
- throw new Error(`[ARTIFACT ERROR] Expected string, got ${typeof path}: ${JSON.stringify(path)}`);
8
- }
9
- const normalizedPath = path.replace(/\\/g, "/"); // Normalize path separators
10
- this.artifacts.push(normalizedPath);
11
- }
12
- constructor(name, index, givens = {}) {
13
- this.artifacts = [];
14
- const suiteName = name || "testSuite"; // Ensure name is never undefined
15
- if (!suiteName) {
16
- throw new Error("BaseSuite requires a non-empty name");
17
- }
18
- this.name = suiteName;
19
- this.index = index;
20
- this.givens = givens;
21
- this.fails = 0;
22
- }
23
- features() {
24
- try {
25
- const features = Object.keys(this.givens)
26
- .map((k) => this.givens[k].features)
27
- .flat()
28
- .filter((value, index, array) => {
29
- return array.indexOf(value) === index;
30
- });
31
- // Convert all features to strings
32
- const stringFeatures = features.map((feature) => {
33
- if (typeof feature === "string") {
34
- return feature;
35
- }
36
- else if (feature && typeof feature === "object") {
37
- return feature.name || JSON.stringify(feature);
38
- }
39
- else {
40
- return String(feature);
41
- }
42
- });
43
- return stringFeatures || [];
44
- }
45
- catch (e) {
46
- console.error("[ERROR] Failed to extract features:", JSON.stringify(e));
47
- return [];
48
- }
49
- }
50
- toObj() {
51
- const givens = Object.keys(this.givens).map((k) => {
52
- const givenObj = this.givens[k].toObj();
53
- // Ensure given features are strings
54
- // if (givenObj.features) {
55
- // givenObj.features = givenObj.features.map(feature => {
56
- // return feature;
57
- // // if (typeof feature === 'string') {
58
- // // return feature;
59
- // // } else if (feature && typeof feature === 'object') {
60
- // // return feature.name || JSON.stringify(feature);
61
- // // } else {
62
- // // return String(feature);
63
- // // }
64
- // });
65
- // }
66
- return givenObj;
67
- });
68
- return {
69
- name: this.name,
70
- givens,
71
- fails: this.fails,
72
- failed: this.failed,
73
- features: this.features(),
74
- artifacts: this.artifacts
75
- ? this.artifacts.filter((art) => typeof art === "string")
76
- : [],
77
- };
78
- }
79
- setup(s, artifactory, tr
80
- // pm: IPM
81
- ) {
82
- console.log("mark9");
83
- return new Promise((res) => res(s));
84
- }
85
- assertThat(t) {
86
- return !!t;
87
- }
88
- afterAll(store, artifactory) {
89
- return store;
90
- }
91
- async run(input, testResourceConfiguration) {
92
- this.testResourceConfiguration = testResourceConfiguration;
93
- const sNdx = this.index;
94
- const subject = await this.setup(input,
95
- // suiteArtifactory,
96
- testResourceConfiguration
97
- // proxiedPm
98
- );
99
- for (const [gKey, g] of Object.entries(this.givens)) {
100
- const giver = this.givens[gKey];
101
- try {
102
- this.store = await giver.give(subject, gKey, testResourceConfiguration, this.assertThat, sNdx);
103
- // Add the number of failures from this given to the suite's total
104
- this.fails += giver.fails || 0;
105
- }
106
- catch (e) {
107
- this.failed = true;
108
- // Add 1 to fails for the caught error
109
- this.fails += 1;
110
- // Also add any failures from the given itself
111
- if (giver.fails) {
112
- this.fails += giver.fails;
113
- }
114
- console.error(`Error in given ${gKey}:`, e);
115
- // Don't re-throw to continue with other givens
116
- }
117
- }
118
- // Mark the suite as failed if there are any failures
119
- if (this.fails > 0) {
120
- this.failed = true;
121
- }
122
- try {
123
- // Ensure addArtifact is properly bound to 'this'
124
- this.afterAll(this.store);
125
- }
126
- catch (e) {
127
- console.error(JSON.stringify(e));
128
- // this.fails.push(this);
129
- // return this;
130
- }
131
- return this;
132
- }
133
- }
134
- exports.BaseSuite = BaseSuite;
@@ -1,65 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BaseThen = void 0;
4
- class BaseThen {
5
- constructor(name, thenCB) {
6
- this.artifacts = [];
7
- this.name = name;
8
- this.thenCB = thenCB;
9
- this.error = false;
10
- this.artifacts = [];
11
- }
12
- addArtifact(path) {
13
- if (typeof path !== "string") {
14
- throw new Error(`[ARTIFACT ERROR] Expected string, got ${typeof path}: ${JSON.stringify(path)}`);
15
- }
16
- const normalizedPath = path.replace(/\\/g, "/"); // Normalize path separators
17
- this.artifacts.push(normalizedPath);
18
- }
19
- toObj() {
20
- const obj = {
21
- name: this.name,
22
- error: this.error,
23
- artifacts: this.artifacts,
24
- status: this.status,
25
- };
26
- return obj;
27
- }
28
- async test(store, testResourceConfiguration,
29
- // tLog: ITLog,
30
- // pm: IPM,
31
- filepath) {
32
- // Ensure addArtifact is properly bound to 'this'
33
- const addArtifact = this.addArtifact.bind(this);
34
- // const proxiedPm = butThenProxy(pm, filepath, addArtifact);
35
- try {
36
- const x = await this.butThen(store, async (s) => {
37
- try {
38
- if (typeof this.thenCB === "function") {
39
- const result = await this.thenCB(s);
40
- return result;
41
- }
42
- else {
43
- return this.thenCB;
44
- }
45
- }
46
- catch (e) {
47
- // Mark this then step as failed
48
- this.error = true;
49
- // Re-throw to be caught by the outer catch block
50
- throw e;
51
- }
52
- }, testResourceConfiguration
53
- // proxiedPm
54
- );
55
- this.status = true;
56
- return x;
57
- }
58
- catch (e) {
59
- this.status = false;
60
- this.error = true;
61
- throw e;
62
- }
63
- }
64
- }
65
- exports.BaseThen = BaseThen;
@@ -1,193 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const BaseGiven_1 = require("./BaseGiven");
4
- const BaseSuite_1 = require("./BaseSuite");
5
- const BaseThen_js_1 = require("./BaseThen.js");
6
- const BaseWhen_js_1 = require("./BaseWhen.js");
7
- const index_js_1 = require("./index.js");
8
- class BaseTiposkripto {
9
- constructor(webOrNode, input, testSpecification, testImplementation, testResourceRequirement = index_js_1.defaultTestResourceRequirement, testAdapter = {}, testResourceConfiguration, wsPort = "3456", wsHost = "localhost") {
10
- this.totalTests = 0;
11
- this.artifacts = [];
12
- this.testResourceConfiguration = testResourceConfiguration;
13
- const fullAdapter = (0, index_js_1.DefaultAdapter)(testAdapter);
14
- if (!testImplementation.suites ||
15
- typeof testImplementation.suites !== "object") {
16
- throw new Error(`testImplementation.suites must be an object, got ${typeof testImplementation.suites}: ${JSON.stringify(testImplementation.suites)}`);
17
- }
18
- const classySuites = Object.entries(testImplementation.suites).reduce((a, [key], index) => {
19
- a[key] = (somestring, givens) => {
20
- return new (class extends BaseSuite_1.BaseSuite {
21
- afterAll(store) {
22
- return fullAdapter.afterAll(store);
23
- }
24
- assertThat(t) {
25
- return fullAdapter.assertThis(t);
26
- }
27
- async setup(s, tr) {
28
- var _a, _b;
29
- return ((_b = (_a = fullAdapter.beforeAll) === null || _a === void 0 ? void 0 : _a.call(fullAdapter, s, tr)) !== null && _b !== void 0 ? _b : s);
30
- }
31
- })(somestring, index, givens);
32
- };
33
- return a;
34
- }, {});
35
- const classyGivens = Object.entries(testImplementation.givens).reduce((a, [key, g]) => {
36
- a[key] = (features, whens, thens, gcb, initialValues) => {
37
- // WTF
38
- // Ensure parameters are arrays and create copies to avoid reference issues
39
- const safeFeatures = Array.isArray(features) ? [...features] : [];
40
- const safeWhens = Array.isArray(whens) ? [...whens] : [];
41
- const safeThens = Array.isArray(thens) ? [...thens] : [];
42
- return new (class extends BaseGiven_1.BaseGiven {
43
- async givenThat(subject, testResource, initializer, initialValues) {
44
- return fullAdapter.beforeEach(subject, initializer, testResource, initialValues);
45
- }
46
- afterEach(store, key) {
47
- return Promise.resolve(fullAdapter.afterEach(store, key));
48
- }
49
- })(safeFeatures, safeWhens, safeThens, testImplementation.givens[key], initialValues);
50
- };
51
- return a;
52
- }, {});
53
- const classyWhens = Object.entries(testImplementation.whens).reduce((a, [key, whEn]) => {
54
- a[key] = (...payload) => {
55
- const whenInstance = new (class extends BaseWhen_js_1.BaseWhen {
56
- async andWhen(store, whenCB, testResource) {
57
- return await fullAdapter.andWhen(store, whenCB, testResource);
58
- }
59
- })(`${key}: ${payload && payload.toString()}`, whEn(...payload));
60
- return whenInstance;
61
- };
62
- return a;
63
- }, {});
64
- const classyThens = Object.entries(testImplementation.thens).reduce((a, [key, thEn]) => {
65
- a[key] = (...args) => {
66
- const thenInstance = new (class extends BaseThen_js_1.BaseThen {
67
- async butThen(store, thenCB, testResource) {
68
- return await fullAdapter.butThen(store, thenCB, testResource);
69
- }
70
- })(`${key}: ${args && args.toString()}`, thEn(...args));
71
- return thenInstance;
72
- };
73
- return a;
74
- }, {});
75
- this.suitesOverrides = classySuites;
76
- this.givenOverrides = classyGivens;
77
- this.whenOverrides = classyWhens;
78
- this.thenOverrides = classyThens;
79
- this.testResourceRequirement = testResourceRequirement;
80
- this.testSpecification = testSpecification;
81
- this.specs = testSpecification(this.Suites(), this.Given(), this.When(), this.Then());
82
- this.totalTests = this.calculateTotalTests();
83
- this.testJobs = this.specs.map((suite) => {
84
- const suiteRunner = (suite) => async (testResourceConfiguration) => {
85
- try {
86
- const x = await suite.run(input, testResourceConfiguration || {
87
- name: suite.name,
88
- fs: process.cwd(),
89
- ports: [],
90
- timeout: 30000,
91
- retries: 3,
92
- environment: {},
93
- });
94
- return x;
95
- }
96
- catch (e) {
97
- console.error(e.stack);
98
- throw e;
99
- }
100
- };
101
- const runner = suiteRunner(suite);
102
- const totalTests = this.totalTests;
103
- const testJob = {
104
- test: suite,
105
- toObj: () => {
106
- return suite.toObj();
107
- },
108
- runner,
109
- receiveTestResourceConfig: async (testResourceConfiguration) => {
110
- try {
111
- const suiteDone = await runner(testResourceConfiguration);
112
- const fails = suiteDone.fails;
113
- return {
114
- failed: fails > 0,
115
- fails,
116
- artifacts: [], // this.artifacts is not accessible here
117
- features: suiteDone.features(),
118
- tests: 0,
119
- runTimeTests: totalTests,
120
- testJob: testJob.toObj(),
121
- };
122
- }
123
- catch (e) {
124
- console.error(e.stack);
125
- return {
126
- failed: true,
127
- fails: -1,
128
- artifacts: [],
129
- features: [],
130
- tests: 0,
131
- runTimeTests: -1,
132
- testJob: testJob.toObj(),
133
- };
134
- }
135
- },
136
- };
137
- return testJob;
138
- });
139
- this.testJobs[0].receiveTestResourceConfig(testResourceConfiguration).then((results) => {
140
- // The actual path is determined by the concrete implementation (Node.ts or Web.ts)
141
- // They will write to the correct pattern: testeranto/reports/allTests/example/${runtime}.Calculator.test.ts.json
142
- // We just pass a placeholder filename webOrNode
143
- this.writeFileSync(`testeranto/reports/allTests/example/${webOrNode}/Calculator.test.ts.json`, JSON.stringify(results));
144
- });
145
- }
146
- async receiveTestResourceConfig(testResourceConfig) {
147
- if (this.testJobs && this.testJobs.length > 0) {
148
- return this.testJobs[0].receiveTestResourceConfig(testResourceConfig);
149
- }
150
- else {
151
- throw new Error("No test jobs available");
152
- }
153
- }
154
- Specs() {
155
- return this.specs;
156
- }
157
- Suites() {
158
- if (!this.suitesOverrides) {
159
- throw new Error(`suitesOverrides is undefined. classySuites: ${JSON.stringify(Object.keys(this.suitesOverrides || {}))}`);
160
- }
161
- return this.suitesOverrides;
162
- }
163
- Given() {
164
- return this.givenOverrides;
165
- }
166
- When() {
167
- return this.whenOverrides;
168
- }
169
- Then() {
170
- return this.thenOverrides;
171
- }
172
- // Add a method to access test jobs which can be used by receiveTestResourceConfig
173
- getTestJobs() {
174
- return this.testJobs;
175
- }
176
- calculateTotalTests() {
177
- let total = 0;
178
- for (const suite of this.specs) {
179
- if (suite && typeof suite === "object") {
180
- // Access the givens property which should be a record of test names to BaseGiven instances
181
- // The givens property is typically on the suite instance
182
- if ("givens" in suite) {
183
- const givens = suite.givens;
184
- if (givens && typeof givens === "object") {
185
- total += Object.keys(givens).length;
186
- }
187
- }
188
- }
189
- }
190
- return total;
191
- }
192
- }
193
- exports.default = BaseTiposkripto;
@@ -1,46 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BaseWhen = void 0;
4
- class BaseWhen {
5
- addArtifact(path) {
6
- if (typeof path !== "string") {
7
- throw new Error(`[ARTIFACT ERROR] Expected string, got ${typeof path}: ${JSON.stringify(path)}`);
8
- }
9
- const normalizedPath = path.replace(/\\/g, "/"); // Normalize path separators
10
- this.artifacts.push(normalizedPath);
11
- }
12
- constructor(name, whenCB) {
13
- this.artifacts = [];
14
- this.name = name;
15
- this.whenCB = whenCB;
16
- }
17
- toObj() {
18
- const obj = {
19
- name: this.name,
20
- status: this.status,
21
- error: this.error
22
- ? `${this.error.name}: ${this.error.message}\n${this.error.stack}`
23
- : null,
24
- artifacts: this.artifacts,
25
- };
26
- return obj;
27
- }
28
- async test(store, testResourceConfiguration) {
29
- try {
30
- // Ensure addArtifact is properly bound to 'this'
31
- // const addArtifact = this.addArtifact.bind(this);
32
- // const proxiedPm = andWhenProxy(pm, filepath, addArtifact);
33
- const result = await this.andWhen(store, this.whenCB, testResourceConfiguration
34
- // proxiedPm
35
- );
36
- this.status = true;
37
- return result;
38
- }
39
- catch (e) {
40
- this.status = false;
41
- this.error = e;
42
- throw e;
43
- }
44
- }
45
- }
46
- exports.BaseWhen = BaseWhen;
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,40 +0,0 @@
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
- exports.NodeTiposkripto = void 0;
7
- const fs_1 = __importDefault(require("fs"));
8
- const BaseTiposkripto_js_1 = __importDefault(require("./BaseTiposkripto.js"));
9
- const index_js_1 = require("./index.js");
10
- console.log(`[NodeTiposkripto] ${process.argv}`);
11
- const config = { ports: [1111], fs: 'testeranto/reports/allTests/example/Calculator.test/node' };
12
- class NodeTiposkripto extends BaseTiposkripto_js_1.default {
13
- constructor(input, testSpecification, testImplementation, testResourceRequirement, testAdapter) {
14
- // console.log(`[NodeTiposkripto] constructor ${process.argv[3]}`);
15
- // const config = JSON.parse(process.argv[3])
16
- super("node", input, testSpecification, testImplementation, testResourceRequirement, testAdapter, config);
17
- }
18
- writeFileSync(filename, payload) {
19
- console.log('writeFileSync', filename);
20
- const dir = "testeranto/reports/allTests/example";
21
- if (!fs_1.default.existsSync(dir)) {
22
- fs_1.default.mkdirSync(dir, { recursive: true });
23
- }
24
- // Write to the exact filename provided
25
- fs_1.default.writeFileSync(filename, payload);
26
- }
27
- }
28
- exports.NodeTiposkripto = NodeTiposkripto;
29
- const tiposkripto = async (input, testSpecification, testImplementation, testAdapter, testResourceRequirement = index_js_1.defaultTestResourceRequirement) => {
30
- try {
31
- const t = new NodeTiposkripto(input, testSpecification, testImplementation, testResourceRequirement, testAdapter);
32
- return t;
33
- }
34
- catch (e) {
35
- console.error(`[Node] Error creating Tiposkripto:`, e);
36
- console.error(e.stack);
37
- process.exit(-1);
38
- }
39
- };
40
- exports.default = tiposkripto;
@@ -1,49 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- Object.defineProperty(exports, "__esModule", { value: true });
36
- const _1 = require(".");
37
- let tpskrt;
38
- if (ENV === "node") {
39
- tpskrt = await Promise.resolve().then(() => __importStar(require("./Node")));
40
- }
41
- else if (ENV === "web") {
42
- tpskrt = await Promise.resolve().then(() => __importStar(require("./Web")));
43
- }
44
- else {
45
- throw `Unknown ENV ${ENV}`;
46
- }
47
- exports.default = async (input, testSpecification, testImplementation, testAdapter, testResourceRequirement = _1.defaultTestResourceRequirement, testResourceConfiguration) => {
48
- return (await tpskrt.default)(input, testSpecification, testImplementation, testResourceRequirement, testAdapter, testResourceConfiguration);
49
- };
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,70 +0,0 @@
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
- exports.WebTiposkripto = void 0;
7
- const BaseTiposkripto_js_1 = __importDefault(require("./BaseTiposkripto.js"));
8
- const index_js_1 = require("./index.js");
9
- const config = {
10
- name: 'web',
11
- fs: 'testeranto/reports/allTests/example/Calculator.test/web',
12
- ports: [1111],
13
- files: [],
14
- timeout: 30000,
15
- retries: 3,
16
- environment: {}
17
- };
18
- class WebTiposkripto extends BaseTiposkripto_js_1.default {
19
- constructor(input, testSpecification, testImplementation, testResourceRequirement, testAdapter) {
20
- const urlParams = new URLSearchParams(window.location.search);
21
- const encodedConfig = urlParams.get("config");
22
- const testResourceConfig = encodedConfig
23
- ? decodeURIComponent(encodedConfig)
24
- : "{}";
25
- super("web", input, testSpecification, testImplementation, testResourceRequirement, testAdapter,
26
- // JSON.parse(testResourceConfig)
27
- config);
28
- }
29
- writeFileSync(filename, payload) {
30
- // Store files in a global object that can be accessed via Puppeteer
31
- if (!window.__testeranto_files__) {
32
- window.__testeranto_files__ = {};
33
- }
34
- window.__testeranto_files__[filename] = payload;
35
- // Also try to use the File System Access API if available
36
- if (navigator.storage && navigator.storage.getDirectory) {
37
- (async () => {
38
- try {
39
- const root = await navigator.storage.getDirectory();
40
- const fileHandle = await root.getFileHandle(filename, { create: true });
41
- const writable = await fileHandle.createWritable();
42
- await writable.write(payload);
43
- await writable.close();
44
- }
45
- catch (e) {
46
- console.warn('Could not write to browser storage:', e);
47
- }
48
- })();
49
- }
50
- }
51
- }
52
- exports.WebTiposkripto = WebTiposkripto;
53
- const tiposkripto = async (input, testSpecification, testImplementation, testAdapter, testResourceRequirement = index_js_1.defaultTestResourceRequirement) => {
54
- try {
55
- const t = new WebTiposkripto(input, testSpecification, testImplementation, testResourceRequirement, testAdapter);
56
- // const data = navigator.storage.
57
- const root = await navigator.storage.getDirectory();
58
- // 1. Create (or get) a file handle
59
- const fileHandle = await root.getFileHandle(`${config.fs}/tests.json`);
60
- return t;
61
- }
62
- catch (e) {
63
- console.error(e);
64
- // Dispatch an error event
65
- const errorEvent = new CustomEvent("test-error", { detail: e });
66
- window.dispatchEvent(errorEvent);
67
- throw e;
68
- }
69
- };
70
- exports.default = tiposkripto;
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MockGiven = void 0;
4
- const BaseGiven_1 = require("../BaseGiven");
5
- class MockGiven extends BaseGiven_1.BaseGiven {
6
- constructor(name, features, whens, thens, givenCB, initialValues) {
7
- super(name, features, whens, thens, givenCB, initialValues);
8
- }
9
- async givenThat(subject, testResourceConfiguration, artifactory, givenCB, initialValues) {
10
- // Call the givenCB which is a function that returns the store
11
- const result = givenCB();
12
- if (typeof result === "function") {
13
- return result();
14
- }
15
- return result;
16
- }
17
- uberCatcher(e) {
18
- console.error("MockGiven error:", e);
19
- this.error = e;
20
- }
21
- }
22
- exports.MockGiven = MockGiven;
@@ -1,16 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MockThen = void 0;
4
- const BaseThen_1 = require("../BaseThen");
5
- class MockThen extends BaseThen_1.BaseThen {
6
- constructor(name, thenCB) {
7
- super(name, thenCB);
8
- }
9
- async butThen(store, thenCB, testResourceConfiguration) {
10
- // The thenCB expects a selection, not the store directly
11
- // We need to extract the selection from the store
12
- const selection = { testSelection: store.testSelection };
13
- return thenCB(selection);
14
- }
15
- }
16
- exports.MockThen = MockThen;
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MockWhen = void 0;
4
- const BaseWhen_1 = require("../BaseWhen");
5
- class MockWhen extends BaseWhen_1.BaseWhen {
6
- constructor(name, whenCB) {
7
- super(name, whenCB);
8
- }
9
- async andWhen(store, whenCB, testResource) {
10
- // The whenCB returns a function that takes the store
11
- const result = whenCB(store);
12
- if (typeof result === "function") {
13
- return result(store);
14
- }
15
- return result;
16
- }
17
- }
18
- exports.MockWhen = MockWhen;