testeranto 0.219.17 → 0.219.19

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 (257) hide show
  1. package/dist/common/allTestsUtils.js +17 -0
  2. package/dist/common/scripts/build-example.js +105 -0
  3. package/dist/common/src/Init.js +38 -0
  4. package/dist/common/src/Types.js +2 -0
  5. package/dist/common/src/esbuildConfigs/consoleDetectorPlugin.js +38 -0
  6. package/dist/common/src/esbuildConfigs/eslint-formatter-testeranto.js +21 -0
  7. package/dist/common/src/esbuildConfigs/featuresPlugin.js +39 -0
  8. package/dist/common/src/esbuildConfigs/index.js +22 -0
  9. package/dist/common/src/esbuildConfigs/inputFilesPlugin.js +30 -0
  10. package/dist/common/src/esbuildConfigs/nativeImportDetectorPlugin.js +24 -0
  11. package/dist/common/src/esbuildConfigs/rebuildPlugin.js +19 -0
  12. package/dist/common/src/init-docs.js +9 -0
  13. package/dist/common/src/lib/tiposkripto/src/BaseGiven.js +96 -0
  14. package/dist/common/src/lib/tiposkripto/src/BaseSuite.js +134 -0
  15. package/dist/common/src/lib/tiposkripto/src/BaseThen.js +65 -0
  16. package/dist/common/src/lib/tiposkripto/src/BaseTiposkripto.js +194 -0
  17. package/dist/common/src/lib/tiposkripto/src/BaseWhen.js +46 -0
  18. package/dist/common/src/lib/tiposkripto/src/CoreTypes.js +2 -0
  19. package/dist/common/src/lib/tiposkripto/src/Node.js +40 -0
  20. package/dist/common/src/lib/tiposkripto/src/Web.js +70 -0
  21. package/dist/common/src/lib/tiposkripto/src/index.js +85 -0
  22. package/dist/common/src/lib/tiposkripto/src/types.js +6 -0
  23. package/dist/common/src/lib/tiposkripto/tests/abstractBase.test/MockGiven.js +22 -0
  24. package/dist/common/src/lib/tiposkripto/tests/abstractBase.test/MockThen.js +16 -0
  25. package/dist/common/src/lib/tiposkripto/tests/abstractBase.test/MockWhen.js +18 -0
  26. package/dist/common/src/lib/tiposkripto/tests/abstractBase.test/adapter.js +24 -0
  27. package/dist/common/src/lib/tiposkripto/tests/abstractBase.test/implementation.js +38 -0
  28. package/dist/common/src/lib/tiposkripto/tests/abstractBase.test/index.js +17 -0
  29. package/dist/common/src/lib/tiposkripto/tests/abstractBase.test/specification.js +19 -0
  30. package/dist/common/src/lib/tiposkripto/tests/abstractBase.test/types.js +2 -0
  31. package/dist/common/src/runtimes.js +4 -0
  32. package/dist/common/src/server/aider/configParser.js +124 -0
  33. package/dist/common/src/server/aider/docker.js +30 -0
  34. package/dist/common/src/server/getRunnables.js +36 -0
  35. package/dist/common/src/server/htmlTemplate.js +44 -0
  36. package/dist/common/src/server/nodeVersion.js +5 -0
  37. package/dist/common/src/server/runtimes/common.js +136 -0
  38. package/dist/common/src/server/runtimes/golang/docker.js +62 -0
  39. package/dist/common/src/server/runtimes/java/docker.js +46 -0
  40. package/dist/common/src/server/runtimes/node/docker.js +45 -0
  41. package/dist/common/src/server/runtimes/node/esbuild.js +40 -0
  42. package/dist/common/src/server/runtimes/node/node.js +75 -0
  43. package/dist/common/src/server/runtimes/python/docker.js +31 -0
  44. package/dist/common/src/server/runtimes/ruby/docker.js +34 -0
  45. package/dist/common/src/server/runtimes/rust/docker.js +35 -0
  46. package/dist/common/src/server/runtimes/web/docker.js +42 -0
  47. package/dist/common/src/server/runtimes/web/esbuild.js +29 -0
  48. package/dist/common/src/server/runtimes/web/hoist.js +16 -0
  49. package/dist/common/src/server/runtimes/web/web.js +157 -0
  50. package/dist/common/src/server/serverClasees/Server.js +47 -0
  51. package/dist/common/src/server/serverClasees/Server_Base.js +18 -0
  52. package/dist/common/src/server/serverClasees/Server_Docker.js +905 -0
  53. package/dist/common/src/server/serverClasees/Server_FS.js +119 -0
  54. package/dist/common/src/server/serverClasees/Server_HTTP.js +189 -0
  55. package/dist/common/src/server/serverClasees/Server_WS.js +262 -0
  56. package/dist/common/src/server/serverManagers/DockerManager.js +28 -0
  57. package/dist/common/src/server/serverManagers/HttpManager.js +114 -0
  58. package/dist/common/src/server/serverManagers/WsManager.js +230 -0
  59. package/dist/common/src/server/serverManagers/fs.js +32 -0
  60. package/dist/common/src/server/serverManagers/tcp.js +51 -0
  61. package/dist/common/src/server/types.js +2 -0
  62. package/dist/common/src/testeranto.js +47 -0
  63. package/dist/common/src/vscode/TerminalManager.js +129 -0
  64. package/dist/common/src/vscode/TestTreeItem.js +77 -0
  65. package/dist/common/src/vscode/extension.js +185 -0
  66. package/dist/common/src/vscode/providers/FeaturesTreeDataProvider.js +445 -0
  67. package/dist/common/src/vscode/providers/FileTreeDataProvider.js +190 -0
  68. package/dist/common/src/vscode/providers/ProcessesTreeDataProvider.js +270 -0
  69. package/dist/common/src/vscode/providers/ResultsTreeDataProvider.js +87 -0
  70. package/dist/common/src/vscode/providers/TestTreeDataProvider.js +309 -0
  71. package/dist/common/src/vscode/types.js +9 -0
  72. package/dist/common/testeranto/runtimes/node/node.js +7 -0
  73. package/dist/common/testeranto/runtimes/web/web.js +6 -0
  74. package/dist/common/testeranto/testeranto.js +80 -0
  75. package/dist/common/tsconfig.common.tsbuildinfo +1 -0
  76. package/dist/module/allTestsUtils.js +13 -0
  77. package/dist/module/scripts/build-example.js +100 -0
  78. package/dist/module/src/Init.js +33 -0
  79. package/dist/module/src/Types.js +1 -0
  80. package/dist/module/src/esbuildConfigs/consoleDetectorPlugin.js +32 -0
  81. package/dist/module/src/esbuildConfigs/eslint-formatter-testeranto.js +18 -0
  82. package/dist/module/src/esbuildConfigs/featuresPlugin.js +34 -0
  83. package/dist/module/src/esbuildConfigs/index.js +20 -0
  84. package/dist/module/src/esbuildConfigs/inputFilesPlugin.js +25 -0
  85. package/dist/module/src/esbuildConfigs/nativeImportDetectorPlugin.js +21 -0
  86. package/dist/module/src/esbuildConfigs/rebuildPlugin.js +14 -0
  87. package/dist/module/src/init-docs.js +4 -0
  88. package/dist/module/src/lib/tiposkripto/src/BaseGiven.js +92 -0
  89. package/dist/module/src/lib/tiposkripto/src/BaseSuite.js +130 -0
  90. package/dist/module/src/lib/tiposkripto/src/BaseThen.js +61 -0
  91. package/dist/module/src/lib/tiposkripto/src/BaseTiposkripto.js +191 -0
  92. package/dist/module/src/lib/tiposkripto/src/BaseWhen.js +42 -0
  93. package/dist/module/src/lib/tiposkripto/src/CoreTypes.js +1 -0
  94. package/dist/module/src/lib/tiposkripto/src/Node.js +33 -0
  95. package/dist/module/src/lib/tiposkripto/src/Web.js +63 -0
  96. package/dist/module/src/lib/tiposkripto/src/types.js +3 -0
  97. package/dist/module/src/lib/tiposkripto/tests/abstractBase.test/MockGiven.js +18 -0
  98. package/dist/module/src/lib/tiposkripto/tests/abstractBase.test/MockThen.js +12 -0
  99. package/dist/module/src/lib/tiposkripto/tests/abstractBase.test/MockWhen.js +14 -0
  100. package/dist/module/src/lib/tiposkripto/tests/abstractBase.test/adapter.js +21 -0
  101. package/dist/module/src/lib/tiposkripto/tests/abstractBase.test/implementation.js +35 -0
  102. package/dist/module/src/lib/tiposkripto/tests/abstractBase.test/index.js +12 -0
  103. package/dist/module/src/lib/tiposkripto/tests/abstractBase.test/specification.js +15 -0
  104. package/dist/module/src/lib/tiposkripto/tests/abstractBase.test/types.js +1 -0
  105. package/dist/module/src/runtimes.js +1 -0
  106. package/dist/module/src/server/aider/configParser.js +116 -0
  107. package/dist/module/src/server/aider/docker.js +28 -0
  108. package/dist/module/src/server/getRunnables.js +29 -0
  109. package/dist/module/src/server/htmlTemplate.js +40 -0
  110. package/dist/module/src/server/nodeVersion.js +2 -0
  111. package/dist/module/src/server/runtimes/common.js +127 -0
  112. package/dist/module/src/server/runtimes/golang/docker.js +55 -0
  113. package/dist/module/src/server/runtimes/java/docker.js +40 -0
  114. package/dist/module/src/server/runtimes/node/docker.js +39 -0
  115. package/dist/module/src/server/runtimes/node/esbuild.js +35 -0
  116. package/dist/module/src/server/runtimes/node/node.js +37 -0
  117. package/dist/module/src/server/runtimes/python/docker.js +25 -0
  118. package/dist/module/src/server/runtimes/ruby/docker.js +28 -0
  119. package/dist/module/src/server/runtimes/rust/docker.js +29 -0
  120. package/dist/module/src/server/runtimes/web/docker.js +36 -0
  121. package/dist/module/src/server/runtimes/web/esbuild.js +24 -0
  122. package/dist/module/src/server/runtimes/web/hoist.js +11 -0
  123. package/dist/module/src/server/runtimes/web/web.js +119 -0
  124. package/dist/module/src/server/serverClasees/Server.js +40 -0
  125. package/dist/module/src/server/serverClasees/Server_Base.js +14 -0
  126. package/dist/module/src/server/serverClasees/Server_Docker.js +898 -0
  127. package/dist/module/src/server/serverClasees/Server_FS.js +119 -0
  128. package/dist/module/src/server/serverClasees/Server_HTTP.js +182 -0
  129. package/dist/module/src/server/serverClasees/Server_WS.js +258 -0
  130. package/dist/module/src/server/serverManagers/DockerManager.js +28 -0
  131. package/dist/module/src/server/serverManagers/HttpManager.js +110 -0
  132. package/dist/module/src/server/serverManagers/WsManager.js +226 -0
  133. package/dist/module/src/server/serverManagers/fs.js +32 -0
  134. package/dist/module/src/server/serverManagers/tcp.js +47 -0
  135. package/dist/module/src/server/types.js +1 -0
  136. package/dist/module/src/testeranto.js +12 -0
  137. package/dist/module/src/vscode/TerminalManager.js +92 -0
  138. package/dist/module/src/vscode/TestTreeItem.js +40 -0
  139. package/dist/module/src/vscode/extension.js +148 -0
  140. package/dist/module/src/vscode/providers/FeaturesTreeDataProvider.js +408 -0
  141. package/dist/module/src/vscode/providers/FileTreeDataProvider.js +153 -0
  142. package/dist/module/src/vscode/providers/ProcessesTreeDataProvider.js +233 -0
  143. package/dist/module/src/vscode/providers/ResultsTreeDataProvider.js +50 -0
  144. package/dist/module/src/vscode/providers/TestTreeDataProvider.js +272 -0
  145. package/dist/module/src/vscode/types.js +6 -0
  146. package/dist/module/testeranto/runtimes/node/node.js +5 -0
  147. package/dist/module/testeranto/runtimes/web/web.js +4 -0
  148. package/dist/module/testeranto/testeranto.js +78 -0
  149. package/dist/module/tsconfig.module.tsbuildinfo +1 -0
  150. package/dist/prebuild/testeranto.mjs +9 -16
  151. package/dist/types/Init.d.ts +2 -0
  152. package/dist/types/Types.d.ts +67 -0
  153. package/dist/types/esbuildConfigs/consoleDetectorPlugin.d.ts +2 -0
  154. package/dist/types/esbuildConfigs/eslint-formatter-testeranto.d.ts +2 -0
  155. package/dist/types/esbuildConfigs/featuresPlugin.d.ts +5 -0
  156. package/dist/types/esbuildConfigs/index.d.ts +3 -0
  157. package/dist/types/esbuildConfigs/inputFilesPlugin.d.ts +7 -0
  158. package/dist/types/esbuildConfigs/nativeImportDetectorPlugin.d.ts +2 -0
  159. package/dist/types/esbuildConfigs/rebuildPlugin.d.ts +6 -0
  160. package/dist/types/init-docs.d.ts +1 -0
  161. package/dist/types/lib/tiposkripto/src/BaseGiven.d.ts +42 -0
  162. package/dist/types/lib/tiposkripto/src/BaseSuite.d.ts +46 -0
  163. package/dist/types/lib/tiposkripto/src/BaseThen.d.ts +28 -0
  164. package/dist/types/lib/tiposkripto/src/BaseTiposkripto.d.ts +35 -0
  165. package/dist/types/lib/tiposkripto/src/BaseWhen.d.ts +27 -0
  166. package/dist/types/lib/tiposkripto/src/CoreTypes.d.ts +55 -0
  167. package/dist/types/lib/tiposkripto/src/Node.d.ts +9 -0
  168. package/dist/types/lib/tiposkripto/src/Web.d.ts +9 -0
  169. package/dist/types/lib/tiposkripto/src/types.d.ts +60 -0
  170. package/dist/types/lib/tiposkripto/tests/abstractBase.test/MockGiven.d.ts +9 -0
  171. package/dist/types/lib/tiposkripto/tests/abstractBase.test/MockThen.d.ts +6 -0
  172. package/dist/types/lib/tiposkripto/tests/abstractBase.test/MockWhen.d.ts +6 -0
  173. package/dist/types/lib/tiposkripto/tests/abstractBase.test/adapter.d.ts +3 -0
  174. package/dist/types/lib/tiposkripto/tests/abstractBase.test/implementation.d.ts +3 -0
  175. package/dist/types/lib/tiposkripto/tests/abstractBase.test/index.d.ts +2 -0
  176. package/dist/types/lib/tiposkripto/tests/abstractBase.test/specification.d.ts +3 -0
  177. package/dist/types/lib/tiposkripto/tests/abstractBase.test/types.d.ts +39 -0
  178. package/dist/types/runtimes.d.ts +2 -0
  179. package/dist/types/server/aider/configParser.d.ts +11 -0
  180. package/dist/types/server/aider/docker.d.ts +2 -0
  181. package/dist/types/server/getRunnables.d.ts +3 -0
  182. package/dist/types/server/htmlTemplate.d.ts +2 -0
  183. package/dist/types/server/nodeVersion.d.ts +2 -0
  184. package/dist/types/server/runtimes/common.d.ts +12 -0
  185. package/dist/types/server/runtimes/golang/docker.d.ts +5 -0
  186. package/dist/types/server/runtimes/java/docker.d.ts +14 -0
  187. package/dist/types/server/runtimes/node/docker.d.ts +14 -0
  188. package/dist/types/server/runtimes/node/esbuild.d.ts +4 -0
  189. package/dist/types/server/runtimes/node/node.d.ts +1 -0
  190. package/dist/types/server/runtimes/python/docker.d.ts +14 -0
  191. package/dist/types/server/runtimes/ruby/docker.d.ts +14 -0
  192. package/dist/types/server/runtimes/rust/docker.d.ts +14 -0
  193. package/dist/types/server/runtimes/web/docker.d.ts +15 -0
  194. package/dist/types/server/runtimes/web/esbuild.d.ts +4 -0
  195. package/dist/types/server/runtimes/web/hoist.d.ts +1 -0
  196. package/dist/types/server/runtimes/web/web.d.ts +1 -0
  197. package/dist/types/server/serverClasees/Server.d.ts +8 -0
  198. package/dist/types/server/serverClasees/Server_Base.d.ts +9 -0
  199. package/dist/types/server/serverClasees/Server_Docker.d.ts +81 -0
  200. package/dist/types/server/serverClasees/Server_FS.d.ts +0 -0
  201. package/dist/types/server/serverClasees/Server_HTTP.d.ts +20 -0
  202. package/dist/types/server/serverClasees/Server_WS.d.ts +23 -0
  203. package/dist/types/server/serverManagers/DockerManager.d.ts +0 -0
  204. package/dist/types/server/serverManagers/HttpManager.d.ts +9 -0
  205. package/dist/types/server/serverManagers/WsManager.d.ts +10 -0
  206. package/dist/types/server/serverManagers/fs.d.ts +0 -0
  207. package/dist/types/server/serverManagers/tcp.d.ts +27 -0
  208. package/dist/types/server/types.d.ts +75 -0
  209. package/dist/types/testeranto.d.ts +1 -0
  210. package/dist/types/tsconfig.types.tsbuildinfo +1 -0
  211. package/dist/types/vscode/TerminalManager.d.ts +18 -0
  212. package/dist/types/vscode/TestTreeItem.d.ts +13 -0
  213. package/dist/types/vscode/extension.d.ts +3 -0
  214. package/dist/types/vscode/providers/FeaturesTreeDataProvider.d.ts +17 -0
  215. package/dist/types/vscode/providers/FileTreeDataProvider.d.ts +13 -0
  216. package/dist/types/vscode/providers/ProcessesTreeDataProvider.d.ts +23 -0
  217. package/dist/types/vscode/providers/ResultsTreeDataProvider.d.ts +10 -0
  218. package/dist/types/vscode/providers/TestTreeDataProvider.d.ts +16 -0
  219. package/dist/types/vscode/types.d.ts +14 -0
  220. package/package.json +2 -2
  221. package/src/Types.ts +5 -1
  222. package/src/lib/rubeno/Rakefile +8 -0
  223. package/src/lib/rubeno/bin/rubeno +4 -0
  224. package/src/lib/rubeno/rubeno-0.0.1.gem +0 -0
  225. package/src/lib/rubeno/rubeno-0.0.2.gem +0 -0
  226. package/src/lib/rubeno/rubeno.gemspec +26 -0
  227. package/src/lib/rubeno/tests/test_rubeno.rb +16 -0
  228. package/src/lib/tiposkripto/bundle.js +1 -1
  229. package/src/lib/tiposkripto/dist/common/lib/tiposkripto/src/BaseTiposkripto.js +2 -2
  230. package/src/lib/tiposkripto/dist/common/lib/tiposkripto/src/index.js +85 -0
  231. package/src/lib/tiposkripto/dist/common/tsconfig.common.tsbuildinfo +1 -1
  232. package/src/lib/tiposkripto/dist/module/lib/tiposkripto/src/BaseTiposkripto.js +1 -1
  233. package/src/lib/tiposkripto/dist/{common/lib/tiposkripto/src/index.mjs → module/lib/tiposkripto/src/index.js} +0 -1
  234. package/src/lib/tiposkripto/dist/module/tsconfig.module.tsbuildinfo +1 -1
  235. package/src/lib/tiposkripto/dist/prebuild/{Node-KZP3KCHY.mjs → Node-QKPFQUAO.mjs} +2 -2
  236. package/src/lib/tiposkripto/dist/prebuild/{Web-N3U4GGVG.mjs → Web-54TRFOX2.mjs} +2 -2
  237. package/src/lib/tiposkripto/dist/prebuild/{chunk-IWCYUFDQ.mjs → chunk-57HFMKB2.mjs} +1 -1
  238. package/src/lib/tiposkripto/dist/prebuild/{chunk-MABQI2BP.mjs → chunk-OO6YKXBX.mjs} +3 -3
  239. package/src/lib/tiposkripto/dist/prebuild/index.mjs +1 -1
  240. package/src/lib/tiposkripto/dist/types/lib/tiposkripto/src/index.d.ts +8 -0
  241. package/src/lib/tiposkripto/dist/types/tsconfig.types.tsbuildinfo +1 -1
  242. package/src/lib/tiposkripto/package.json +6 -4
  243. package/src/server/runtimes/node/docker.ts +19 -14
  244. package/src/server/runtimes/ruby/docker.ts +12 -6
  245. package/src/server/runtimes/ruby/ruby.rb +26 -26
  246. package/src/server/serverClasees/Server_Docker.ts +6 -6
  247. package/src/server/types.ts +1 -5
  248. /package/{src/lib/tiposkripto/dist/module/lib/tiposkripto/src/index.mjs → dist/module/src/lib/tiposkripto/src/index.js} +0 -0
  249. /package/{src/lib/tiposkripto/dist/types/lib/tiposkripto/src/index.d.mts → dist/types/lib/tiposkripto/src/index.d.ts} +0 -0
  250. /package/src/lib/rubeno/{base_given.rb → lib/base_given.rb} +0 -0
  251. /package/src/lib/rubeno/{base_suite.rb → lib/base_suite.rb} +0 -0
  252. /package/src/lib/rubeno/{base_then.rb → lib/base_then.rb} +0 -0
  253. /package/src/lib/rubeno/{base_when.rb → lib/base_when.rb} +0 -0
  254. /package/src/lib/rubeno/{pm → lib/pm}/ruby.rb +0 -0
  255. /package/src/lib/rubeno/{rubeno.rb → lib/rubeno.rb} +0 -0
  256. /package/src/lib/rubeno/{simple_adapter.rb → lib/simple_adapter.rb} +0 -0
  257. /package/src/lib/rubeno/{types.rb → lib/types.rb} +0 -0
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createLangConfig = void 0;
4
+ const createLangConfig = (testFile, checks, dockerfile, options) => {
5
+ return {
6
+ plugins: (options === null || options === void 0 ? void 0 : options.plugins) || [],
7
+ loaders: (options === null || options === void 0 ? void 0 : options.loaders) || {},
8
+ tests: { [testFile]: { ports: 0 } },
9
+ externals: (options === null || options === void 0 ? void 0 : options.externals) || [],
10
+ test: options === null || options === void 0 ? void 0 : options.testBlocks,
11
+ prod: options === null || options === void 0 ? void 0 : options.prodBlocks,
12
+ checks,
13
+ volumes: options === null || options === void 0 ? void 0 : options.volumes,
14
+ dockerfile,
15
+ };
16
+ };
17
+ exports.createLangConfig = createLangConfig;
@@ -0,0 +1,105 @@
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 child_process_1 = require("child_process");
7
+ const fs_1 = __importDefault(require("fs"));
8
+ const path_1 = __importDefault(require("path"));
9
+ console.log("Building example project (ES module version)...");
10
+ try {
11
+ // Always work from the project root
12
+ const projectRoot = path_1.default.resolve(import.meta.dirname, "..");
13
+ console.log(`Project root: ${projectRoot}`);
14
+ // Change to project root
15
+ process.chdir(projectRoot);
16
+ console.log(`Current working directory (build-example): ${projectRoot}`);
17
+ // The example directory is now relative to project root
18
+ const exampleDir = path_1.default.join(projectRoot, "example");
19
+ console.log(`Example directory: ${exampleDir}`);
20
+ // Ensure go.mod exists - create one if it doesn't
21
+ const goModPath = path_1.default.join(exampleDir, "go.mod");
22
+ if (!fs_1.default.existsSync(goModPath)) {
23
+ console.log("go.mod not found, creating a new one...");
24
+ const defaultGoMod = `module example
25
+
26
+ go 1.19
27
+ `;
28
+ fs_1.default.writeFileSync(goModPath, defaultGoMod);
29
+ console.log("Created default go.mod");
30
+ }
31
+ else {
32
+ // Read the existing go.mod and remove any replace directives
33
+ let goModContent = fs_1.default.readFileSync(goModPath, "utf8");
34
+ // Remove any replace directives that might cause issues
35
+ const lines = goModContent.split('\n').filter(line => !line.trim().startsWith('replace '));
36
+ // Also remove any require directives for testeranto
37
+ const cleanedLines = lines.filter(line => !line.trim().startsWith('require github.com/adamwong246/testeranto'));
38
+ goModContent = cleanedLines.join('\n');
39
+ fs_1.default.writeFileSync(goModPath, goModContent);
40
+ console.log("Cleaned up go.mod by removing replace and testeranto require directives");
41
+ }
42
+ // Read the current go.mod content
43
+ let goModContent = fs_1.default.readFileSync(goModPath, "utf8");
44
+ // Ensure the module is properly set up
45
+ if (!goModContent.includes("module ")) {
46
+ console.log("Initializing go module...");
47
+ (0, child_process_1.execSync)("go mod init example", {
48
+ stdio: "pipe",
49
+ cwd: exampleDir,
50
+ });
51
+ // Re-read the content
52
+ goModContent = fs_1.default.readFileSync(goModPath, "utf8");
53
+ }
54
+ // Add the replace directive to point to the local testeranto
55
+ // This tells Go to use the local directory instead of trying to download from GitHub
56
+ if (!goModContent.includes("replace github.com/adamwong246/testeranto")) {
57
+ console.log("Adding replace directive...");
58
+ (0, child_process_1.execSync)("go mod edit -replace github.com/adamwong246/testeranto=../", {
59
+ stdio: "pipe",
60
+ cwd: exampleDir,
61
+ });
62
+ }
63
+ // Add the require directive to explicitly list the dependency
64
+ // This ensures the dependency is tracked even if it's not imported directly in the example
65
+ console.log("Adding require directive...");
66
+ try {
67
+ (0, child_process_1.execSync)("go mod edit -require github.com/adamwong246/testeranto@v0.0.0", {
68
+ stdio: "pipe",
69
+ cwd: exampleDir,
70
+ });
71
+ }
72
+ catch (error) {
73
+ // It's okay if this fails - the require might already be there
74
+ console.log("Require directive may already exist");
75
+ }
76
+ // Read the updated content
77
+ goModContent = fs_1.default.readFileSync(goModPath, "utf8");
78
+ console.log("Updated go.mod content:");
79
+ console.log(goModContent);
80
+ // Run go mod tidy to ensure dependencies are correct
81
+ console.log("Running go mod tidy...");
82
+ try {
83
+ const tidyOutput = (0, child_process_1.execSync)("go mod tidy -v", {
84
+ stdio: "pipe",
85
+ encoding: "utf-8",
86
+ cwd: exampleDir,
87
+ });
88
+ console.log("go mod tidy output:");
89
+ console.log(tidyOutput);
90
+ }
91
+ catch (error) {
92
+ console.error("go mod tidy failed:");
93
+ if (error.stdout)
94
+ console.error("stdout:", error.stdout.toString());
95
+ if (error.stderr)
96
+ console.error("stderr:", error.stderr.toString());
97
+ console.error("Continuing despite go mod tidy error...");
98
+ }
99
+ console.log("Example project built successfully!");
100
+ }
101
+ catch (error) {
102
+ console.error("Failed to build example project:");
103
+ console.error(error);
104
+ process.exit(1);
105
+ }
@@ -0,0 +1,38 @@
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 fs_1 = __importDefault(require("fs"));
7
+ exports.default = async () => {
8
+ [
9
+ `testeranto/`,
10
+ `testeranto/bundles/`,
11
+ `testeranto/bundles/node`,
12
+ `testeranto/bundles/web`,
13
+ `testeranto/bundles/pure`,
14
+ `testeranto/bundles/golang`,
15
+ `testeranto/bundles/python`,
16
+ `testeranto/reports/`,
17
+ `testeranto/features/`,
18
+ `testeranto/metafiles/`,
19
+ `testeranto/metafiles/node`,
20
+ `testeranto/metafiles/web`,
21
+ `testeranto/metafiles/pure`,
22
+ `testeranto/metafiles/golang`,
23
+ `testeranto/metafiles/python`,
24
+ ].forEach((f) => {
25
+ try {
26
+ fs_1.default.mkdirSync(`${process.cwd()}/${f}`);
27
+ }
28
+ catch (e) {
29
+ console.error(e);
30
+ }
31
+ });
32
+ fs_1.default.copyFileSync(`node_modules/testeranto/dist/prebuild/Report.js`, `testeranto/Report.js`);
33
+ fs_1.default.copyFileSync(`node_modules/testeranto/dist/prebuild/Report.css`, `testeranto/Report.css`);
34
+ fs_1.default.copyFileSync(`node_modules/testeranto/dist/prebuild/ProcessManager.js`, `testeranto/ProcessManager.js`);
35
+ fs_1.default.copyFileSync(`node_modules/testeranto/dist/prebuild/ProcessManager.css`, `testeranto/ProcessManager.css`);
36
+ fs_1.default.copyFileSync(`node_modules/testeranto/dist/prebuild/Features.js`, `testeranto/ProcessManager.js`);
37
+ fs_1.default.copyFileSync(`node_modules/testeranto/dist/prebuild/Features.css`, `testeranto/ProcessManager.css`);
38
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,38 @@
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.consoleDetectorPlugin = void 0;
7
+ const fs_1 = __importDefault(require("fs"));
8
+ exports.consoleDetectorPlugin = {
9
+ name: "console-detector",
10
+ setup(build) {
11
+ build.onLoad({ filter: /\.(js|ts)$/ }, async (args) => {
12
+ const contents = await fs_1.default.promises.readFile(args.path, "utf8");
13
+ const consolePattern = /console\.(log|error|warn|info|debug|trace|dir|dirxml|table|group|groupEnd|clear|count|countReset|assert|profile|profileEnd|time|timeLog|timeEnd|timeStamp|context|memory)/g;
14
+ const matches = contents.match(consolePattern);
15
+ if (matches) {
16
+ const uniqueMethods = [...new Set(matches)];
17
+ return {
18
+ warnings: uniqueMethods.map((method) => ({
19
+ text: `call of "${method}" was detected, which is not supported in the pure runtime.`,
20
+ // location: {
21
+ // file: args.path,
22
+ // line:
23
+ // contents
24
+ // .split("\n")
25
+ // .findIndex((line) => line.includes(method)) + 1,
26
+ // column: 0,
27
+ // },
28
+ })),
29
+ };
30
+ }
31
+ return null;
32
+ });
33
+ build.onEnd((buildResult) => {
34
+ if (buildResult.warnings.find((br) => br.pluginName === "console-detector"))
35
+ console.warn(`Warning: An unsupported method call was detected in a source file used to build for the pure runtime. It is possible that this method call is in a comment block. If you really want to use this function, change this test to the "node" runtime.`);
36
+ });
37
+ },
38
+ };
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = default_1;
4
+ function default_1(results) {
5
+ return results
6
+ .filter((r) => r.messages.length)
7
+ .map((r) => {
8
+ const path = r.filePath.replace(process.cwd() + "/", "");
9
+ return [
10
+ path,
11
+ ...r.messages.map((m) => {
12
+ var _a;
13
+ return [
14
+ `${m.line}:${m.column} ${m.message} (${m.ruleId || ""})`,
15
+ ...(((_a = m.suggestions) === null || _a === void 0 ? void 0 : _a.map((s) => `- ${s.message}${s.fix ? " (fix)" : ""}`)) || []),
16
+ ].join("\n");
17
+ }),
18
+ ].join("\n");
19
+ })
20
+ .join("\n\n");
21
+ }
@@ -0,0 +1,39 @@
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 path_1 = __importDefault(require("path"));
7
+ exports.default = {
8
+ name: "feature-markdown",
9
+ setup(build) {
10
+ build.onResolve({ filter: /\.md$/ }, (args) => {
11
+ if (args.resolveDir === "")
12
+ return;
13
+ return {
14
+ path: path_1.default.isAbsolute(args.path)
15
+ ? args.path
16
+ : path_1.default.join(args.resolveDir, args.path),
17
+ namespace: "feature-markdown",
18
+ };
19
+ });
20
+ build.onLoad({ filter: /.*/, namespace: "feature-markdown" }, async (args) => {
21
+ // const markdownContent = new TextDecoder().decode(
22
+ // await fs.readFileSync(args.path)
23
+ // );
24
+ // markdownHTML = marked(markdownContent, options?.markedOptions);
25
+ return {
26
+ contents: `file://${args.path}`,
27
+ loader: "text",
28
+ // contents: JSON.stringify({ path: args.path }),
29
+ // loader: "json",
30
+ // contents: JSON.stringify({
31
+ // // html: markdownHTML,
32
+ // raw: markdownContent,
33
+ // filename: args.path, //path.basename(args.path),
34
+ // }),
35
+ // loader: "json",
36
+ };
37
+ });
38
+ },
39
+ };
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ // import { ITestconfig } from "../Types";
4
+ exports.default = (config) => {
5
+ return {
6
+ // packages: "external",
7
+ target: "esnext",
8
+ format: "esm",
9
+ splitting: true,
10
+ outExtension: { ".js": ".mjs" },
11
+ outbase: ".",
12
+ jsx: "transform",
13
+ bundle: true,
14
+ // minify: config.minify === true,
15
+ write: true,
16
+ loader: {
17
+ ".js": "jsx",
18
+ ".png": "binary",
19
+ ".jpg": "binary",
20
+ },
21
+ };
22
+ };
@@ -0,0 +1,30 @@
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 fs_1 = __importDefault(require("fs"));
7
+ const otherInputs = {};
8
+ const register = (entrypoint, sources) => {
9
+ if (!otherInputs[entrypoint]) {
10
+ otherInputs[entrypoint] = new Set();
11
+ }
12
+ sources.forEach((s) => otherInputs[entrypoint].add(s));
13
+ };
14
+ exports.default = (platform, testName) => {
15
+ const f = `${testName}`;
16
+ // if (!fs.existsSync(``)) {
17
+ // fs.mkdirSync(``, { recursive: true });
18
+ // }
19
+ return {
20
+ register,
21
+ inputFilesPluginFactory: {
22
+ name: "metafileWriter",
23
+ setup(build) {
24
+ build.onEnd((result) => {
25
+ fs_1.default.writeFileSync(f, JSON.stringify(result, null, 2));
26
+ });
27
+ },
28
+ },
29
+ };
30
+ };
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.nativeImportDetectorPlugin = void 0;
4
+ const node_module_1 = require("node:module");
5
+ exports.nativeImportDetectorPlugin = {
6
+ name: "native-node-import-filter",
7
+ setup(build) {
8
+ build.onResolve({ filter: /fs/ }, (args) => {
9
+ if ((0, node_module_1.isBuiltin)(args.path)) {
10
+ return {
11
+ warnings: [
12
+ {
13
+ text: `cannot use native node package "${args.path}" in a "pure" test. If you really want to use this package, convert this test from "pure" to "node"`,
14
+ },
15
+ ],
16
+ };
17
+ // throw new Error(
18
+ // `cannot use native node package "${args.path}" in a "pure" test. If you really want to use this package, convert this test from "pure" to "node"`
19
+ // );
20
+ }
21
+ return { path: args.path };
22
+ });
23
+ },
24
+ };
@@ -0,0 +1,19 @@
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 fs_1 = __importDefault(require("fs"));
7
+ exports.default = (r) => {
8
+ return {
9
+ name: "rebuild-notify",
10
+ setup: (build) => {
11
+ build.onEnd((result) => {
12
+ console.log(`${r} > build ended with ${result.errors.length} errors`);
13
+ if (result.errors.length > 0) {
14
+ fs_1.default.writeFileSync(`./testeranto/reports${r}_build_errors`, JSON.stringify(result, null, 2));
15
+ }
16
+ });
17
+ },
18
+ };
19
+ };
@@ -0,0 +1,9 @@
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 Init_1 = __importDefault(require("./Init"));
7
+ console.log("Initializing a testeranto project");
8
+ (0, Init_1.default)();
9
+ console.log("testeranto project initialized");
@@ -0,0 +1,96 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BaseGiven = void 0;
4
+ class BaseGiven {
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(features, whens, thens, givenCB, initialValues) {
13
+ this.artifacts = [];
14
+ this.features = features;
15
+ this.whens = whens;
16
+ this.thens = thens;
17
+ this.givenCB = givenCB;
18
+ this.initialValues = initialValues;
19
+ this.fails = 0; // Initialize fail count
20
+ }
21
+ beforeAll(store) {
22
+ return store;
23
+ }
24
+ toObj() {
25
+ return {
26
+ key: this.key,
27
+ whens: (this.whens || []).map((w) => {
28
+ if (w && w.toObj)
29
+ return w.toObj();
30
+ console.error("When step is not as expected!", JSON.stringify(w));
31
+ return {};
32
+ }),
33
+ thens: (this.thens || []).map((t) => (t && t.toObj ? t.toObj() : {})),
34
+ error: this.error ? [this.error, this.error.stack] : null,
35
+ failed: this.failed,
36
+ features: this.features || [],
37
+ artifacts: this.artifacts,
38
+ status: this.status,
39
+ };
40
+ }
41
+ async afterEach(store, key, artifactory) {
42
+ return store;
43
+ }
44
+ async give(subject, key, testResourceConfiguration, tester, artifactory, suiteNdx) {
45
+ this.key = key;
46
+ this.fails = 0; // Initialize fail count for this given
47
+ const givenArtifactory = (fPath, value) => artifactory(`given-${key}/${fPath}`, value);
48
+ try {
49
+ // Ensure addArtifact is properly bound to 'this'
50
+ const addArtifact = this.addArtifact.bind(this);
51
+ this.store = await this.givenThat(subject, testResourceConfiguration, givenArtifactory, this.givenCB, this.initialValues);
52
+ this.status = true;
53
+ }
54
+ catch (e) {
55
+ this.status = false;
56
+ this.failed = true;
57
+ this.fails++; // Increment fail count
58
+ this.error = e.stack;
59
+ }
60
+ try {
61
+ const whens = this.whens || [];
62
+ for (const [thenNdx, thenStep] of this.thens.entries()) {
63
+ try {
64
+ const t = await thenStep.test(this.store, testResourceConfiguration, `suite-${suiteNdx}/given-${key}/then-${thenNdx}`);
65
+ // If the test doesn't throw, it passed
66
+ tester(t);
67
+ }
68
+ catch (e) {
69
+ // Mark the given as failed if any then step fails
70
+ this.failed = true;
71
+ this.fails++; // Increment fail count
72
+ // Re-throw to propagate the error
73
+ throw e;
74
+ }
75
+ }
76
+ }
77
+ catch (e) {
78
+ this.error = e.stack;
79
+ this.failed = true;
80
+ }
81
+ finally {
82
+ try {
83
+ const addArtifact = this.addArtifact.bind(this);
84
+ await this.afterEach(this.store, this.key);
85
+ }
86
+ catch (e) {
87
+ this.failed = true;
88
+ this.fails++; // Increment fail count
89
+ throw e;
90
+ // this.error = e.message;
91
+ }
92
+ }
93
+ return this.store;
94
+ }
95
+ }
96
+ exports.BaseGiven = BaseGiven;
@@ -0,0 +1,134 @@
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;
@@ -0,0 +1,65 @@
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;