testeranto 0.49.9 → 0.62.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (241) hide show
  1. package/.nvmrc +1 -0
  2. package/README.md +71 -9
  3. package/dist/cjs-shim.js +12 -0
  4. package/dist/common/Features.js +2 -3
  5. package/dist/common/Node.js +53 -61
  6. package/dist/common/Project.js +272 -606
  7. package/dist/common/SubPackages/puppeteer.js +19 -0
  8. package/dist/common/{subPackages → SubPackages}/react/component/node.js +4 -4
  9. package/dist/common/{subPackages → SubPackages}/react/component/web.js +4 -4
  10. package/dist/common/SubPackages/react/jsx/index.js +13 -0
  11. package/dist/common/SubPackages/react/jsx/node.js +10 -0
  12. package/dist/common/SubPackages/react/jsx/web.js +10 -0
  13. package/dist/common/{subPackages → SubPackages}/react-dom/component/node.js +6 -6
  14. package/dist/common/{subPackages → SubPackages}/react-dom/component/web.js +11 -12
  15. package/dist/common/SubPackages/react-dom/jsx/node.js +39 -0
  16. package/dist/common/{subPackages → SubPackages}/react-dom/jsx/web.js +6 -27
  17. package/dist/common/{subPackages → SubPackages}/react-test-renderer/MemoExoticComponent/node.js +2 -2
  18. package/dist/common/{subPackages → SubPackages}/react-test-renderer/component/index.js +26 -15
  19. package/dist/common/{subPackages/react-test-renderer/jsx → SubPackages/react-test-renderer/component}/node.js +3 -5
  20. package/dist/common/{subPackages/react-test-renderer/jsx → SubPackages/react-test-renderer/component}/web.js +3 -5
  21. package/dist/common/{subPackages → SubPackages}/react-test-renderer/fc/node.js +4 -4
  22. package/dist/common/{subPackages → SubPackages}/react-test-renderer/fc/web.js +4 -4
  23. package/dist/common/{subPackages → SubPackages}/react-test-renderer/jsx/index.js +8 -2
  24. package/dist/common/{subPackages/react-test-renderer/jsx-promised → SubPackages/react-test-renderer/jsx}/node.js +4 -4
  25. package/dist/common/{subPackages/react → SubPackages/react-test-renderer}/jsx/web.js +4 -4
  26. package/dist/common/{subPackages → SubPackages}/react-test-renderer/jsx-promised/index.js +2 -2
  27. package/dist/common/{subPackages/react/jsx → SubPackages/react-test-renderer/jsx-promised}/node.js +2 -2
  28. package/dist/common/Types.js +32 -0
  29. package/dist/common/Web.js +41 -112
  30. package/dist/common/electron.js +188 -44
  31. package/dist/common/esbuildConfigs/features.js +14 -0
  32. package/dist/common/esbuildConfigs/index.js +20 -0
  33. package/dist/common/esbuildConfigs/node.js +35 -0
  34. package/dist/common/esbuildConfigs/report.js +48 -0
  35. package/dist/common/esbuildConfigs/tests.js +14 -0
  36. package/dist/common/esbuildConfigs/web.js +50 -0
  37. package/dist/common/lib/abstractBase.js +193 -0
  38. package/dist/common/lib/basebuilder.js +86 -0
  39. package/dist/common/lib/browser.js +26 -0
  40. package/dist/common/lib/classBuilder.js +41 -0
  41. package/dist/common/lib/core.js +52 -0
  42. package/dist/common/lib/index.js +19 -0
  43. package/dist/common/nodeWriterElectron.js +55 -0
  44. package/dist/common/preload.js +22 -21
  45. package/dist/common/report.html.js +31 -0
  46. package/dist/common/tsconfig.common.tsbuildinfo +1 -1
  47. package/dist/common/web.html.js +22 -0
  48. package/dist/module/Features.js +2 -3
  49. package/dist/module/Node.js +53 -61
  50. package/dist/module/Project.js +272 -583
  51. package/dist/module/SubPackages/puppeteer.js +14 -0
  52. package/dist/module/{subPackages → SubPackages}/react/component/node.js +3 -3
  53. package/dist/module/{subPackages → SubPackages}/react/component/web.js +3 -3
  54. package/dist/module/SubPackages/react/jsx/index.js +10 -0
  55. package/dist/module/SubPackages/react/jsx/node.js +5 -0
  56. package/dist/module/SubPackages/react/jsx/web.js +5 -0
  57. package/dist/module/{subPackages → SubPackages}/react-dom/component/node.js +5 -5
  58. package/dist/module/{subPackages → SubPackages}/react-dom/component/web.js +10 -11
  59. package/dist/module/SubPackages/react-dom/jsx/node.js +31 -0
  60. package/dist/module/{subPackages → SubPackages}/react-dom/jsx/web.js +5 -26
  61. package/dist/module/{subPackages → SubPackages}/react-test-renderer/MemoExoticComponent/node.js +2 -2
  62. package/dist/module/{subPackages → SubPackages}/react-test-renderer/component/index.js +23 -15
  63. package/dist/module/{subPackages → SubPackages}/react-test-renderer/component/node.js +2 -2
  64. package/dist/module/{subPackages → SubPackages}/react-test-renderer/component/web.js +2 -2
  65. package/dist/module/{subPackages → SubPackages}/react-test-renderer/fc/node.js +3 -3
  66. package/dist/module/{subPackages → SubPackages}/react-test-renderer/fc/web.js +3 -3
  67. package/dist/module/{subPackages → SubPackages}/react-test-renderer/jsx/index.js +8 -2
  68. package/dist/module/SubPackages/react-test-renderer/jsx/node.js +5 -0
  69. package/dist/module/SubPackages/react-test-renderer/jsx/web.js +5 -0
  70. package/dist/module/{subPackages → SubPackages}/react-test-renderer/jsx-promised/index.js +2 -2
  71. package/dist/module/{subPackages/react-test-renderer/jsx → SubPackages/react-test-renderer/jsx-promised}/node.js +1 -1
  72. package/dist/module/Types.js +30 -1
  73. package/dist/module/Web.js +41 -112
  74. package/dist/module/electron.js +189 -45
  75. package/dist/module/esbuildConfigs/features.js +12 -0
  76. package/dist/module/esbuildConfigs/index.js +18 -0
  77. package/dist/module/esbuildConfigs/node.js +30 -0
  78. package/dist/module/esbuildConfigs/report.js +48 -0
  79. package/dist/module/esbuildConfigs/tests.js +12 -0
  80. package/dist/module/esbuildConfigs/web.js +45 -0
  81. package/dist/module/lib/abstractBase.js +185 -0
  82. package/dist/module/lib/basebuilder.js +82 -0
  83. package/dist/module/lib/browser.js +22 -0
  84. package/dist/module/lib/classBuilder.js +37 -0
  85. package/dist/module/lib/core.js +49 -0
  86. package/dist/module/lib/index.js +15 -0
  87. package/dist/module/nodeWriterElectron.js +52 -0
  88. package/dist/module/preload.js +22 -21
  89. package/dist/module/report.html.js +29 -0
  90. package/dist/module/tsconfig.module.tsbuildinfo +1 -1
  91. package/dist/module/web.html.js +20 -0
  92. package/dist/prebuild/Report.css +10326 -0
  93. package/dist/prebuild/Report.js +37456 -0
  94. package/dist/types/Features.d.ts +5 -5
  95. package/dist/types/Node.d.ts +4 -11
  96. package/dist/types/NodeWriter.d.ts +1 -1
  97. package/dist/types/Project.d.ts +2 -27
  98. package/dist/types/SubPackages/puppeteer.d.ts +6 -0
  99. package/dist/types/SubPackages/react/component/node.d.ts +7 -0
  100. package/dist/types/SubPackages/react/component/web.d.ts +7 -0
  101. package/dist/types/SubPackages/react/jsx/index.d.ts +15 -0
  102. package/dist/types/SubPackages/react/jsx/node.d.ts +4 -0
  103. package/dist/types/SubPackages/react/jsx/web.d.ts +4 -0
  104. package/dist/types/{subPackages → SubPackages}/react-dom/component/node.d.ts +2 -4
  105. package/dist/types/SubPackages/react-dom/component/web.d.ts +5 -0
  106. package/dist/types/{subPackages → SubPackages}/react-dom/jsx/index.d.ts +3 -3
  107. package/dist/types/SubPackages/react-dom/jsx/node.d.ts +6 -0
  108. package/dist/types/SubPackages/react-dom/jsx/web.d.ts +5 -0
  109. package/dist/types/SubPackages/react-test-renderer/MemoExoticComponent/node.d.ts +5 -0
  110. package/dist/types/{subPackages → SubPackages}/react-test-renderer/component/index.d.ts +6 -6
  111. package/dist/types/SubPackages/react-test-renderer/component/node.d.ts +9 -0
  112. package/dist/types/SubPackages/react-test-renderer/component/web.d.ts +4 -0
  113. package/dist/types/SubPackages/react-test-renderer/fc/node.d.ts +8 -0
  114. package/dist/types/SubPackages/react-test-renderer/fc/web.d.ts +8 -0
  115. package/dist/types/{subPackages → SubPackages}/react-test-renderer/jsx/index.d.ts +5 -4
  116. package/dist/types/SubPackages/react-test-renderer/jsx/node.d.ts +9 -0
  117. package/dist/types/SubPackages/react-test-renderer/jsx/web.d.ts +9 -0
  118. package/dist/types/{subPackages → SubPackages}/react-test-renderer/jsx-promised/index.d.ts +4 -4
  119. package/dist/types/SubPackages/react-test-renderer/jsx-promised/node.d.ts +5 -0
  120. package/dist/types/SubPackages/react-test-renderer/jsx-promised/web.d.ts +5 -0
  121. package/dist/types/Types.d.ts +116 -3
  122. package/dist/types/Web.d.ts +4 -11
  123. package/dist/types/esbuildConfigs/features.d.ts +4 -0
  124. package/dist/types/esbuildConfigs/index.d.ts +4 -0
  125. package/dist/types/esbuildConfigs/node.d.ts +4 -0
  126. package/dist/types/esbuildConfigs/report.d.ts +0 -0
  127. package/dist/types/esbuildConfigs/tests.d.ts +4 -0
  128. package/dist/types/esbuildConfigs/web.d.ts +4 -0
  129. package/dist/types/lib/abstractBase.d.ts +102 -0
  130. package/dist/types/lib/basebuilder.d.ts +24 -0
  131. package/dist/types/lib/browser.d.ts +6 -0
  132. package/dist/types/lib/classBuilder.d.ts +6 -0
  133. package/dist/types/lib/core.d.ts +7 -0
  134. package/dist/types/lib/index.d.ts +57 -0
  135. package/dist/types/nodeWriterElectron.d.ts +2 -0
  136. package/dist/types/report.html.d.ts +2 -0
  137. package/dist/types/tsconfig.types.tsbuildinfo +1 -1
  138. package/dist/types/web.html.d.ts +2 -0
  139. package/electronBuild.ts +32 -0
  140. package/index.html +30 -0
  141. package/package.json +120 -85
  142. package/src/Features.ts +2 -4
  143. package/src/Node.ts +114 -160
  144. package/src/NodeWriter.ts +1 -4
  145. package/src/Project.ts +610 -753
  146. package/src/Report.tsx +30 -15
  147. package/src/SubPackages/puppeteer.ts +46 -0
  148. package/src/{subPackages → SubPackages}/react/component/node.ts +12 -32
  149. package/src/SubPackages/react/component/web.ts +53 -0
  150. package/src/SubPackages/react/jsx/index.ts +43 -0
  151. package/src/SubPackages/react/jsx/node.ts +29 -0
  152. package/src/SubPackages/react/jsx/web.ts +28 -0
  153. package/src/{subPackages → SubPackages}/react-dom/component/node.ts +11 -25
  154. package/src/{subPackages → SubPackages}/react-dom/component/web.ts +27 -32
  155. package/src/{subPackages → SubPackages}/react-dom/jsx/index.ts +3 -5
  156. package/src/SubPackages/react-dom/jsx/node.ts +68 -0
  157. package/src/{subPackages → SubPackages}/react-dom/jsx/web.ts +19 -62
  158. package/src/{subPackages → SubPackages}/react-test-renderer/MemoExoticComponent/node.ts +9 -28
  159. package/src/{subPackages → SubPackages}/react-test-renderer/component/index.ts +31 -29
  160. package/src/SubPackages/react-test-renderer/component/node.ts +22 -0
  161. package/src/SubPackages/react-test-renderer/component/web.ts +22 -0
  162. package/src/{subPackages → SubPackages}/react-test-renderer/fc/node.ts +14 -28
  163. package/src/{subPackages → SubPackages}/react-test-renderer/fc/web.ts +9 -25
  164. package/src/{subPackages → SubPackages}/react-test-renderer/jsx/index.ts +19 -16
  165. package/src/SubPackages/react-test-renderer/jsx/node.ts +24 -0
  166. package/src/SubPackages/react-test-renderer/jsx/web.ts +20 -0
  167. package/src/{subPackages → SubPackages}/react-test-renderer/jsx-promised/index.ts +7 -15
  168. package/src/SubPackages/react-test-renderer/jsx-promised/node.ts +19 -0
  169. package/src/SubPackages/react-test-renderer/jsx-promised/web.ts +22 -0
  170. package/src/Types.ts +334 -3
  171. package/src/Web.ts +104 -230
  172. package/src/cjs-shim.js +12 -0
  173. package/src/electron.ts +237 -46
  174. package/src/esbuildConfigs/features.ts +18 -0
  175. package/src/esbuildConfigs/index.ts +22 -0
  176. package/src/esbuildConfigs/node.ts +59 -0
  177. package/src/esbuildConfigs/report.ts +51 -0
  178. package/src/esbuildConfigs/tests.ts +20 -0
  179. package/src/esbuildConfigs/web.ts +73 -0
  180. package/src/lib/abstractBase.ts +459 -0
  181. package/src/lib/basebuilder.ts +253 -0
  182. package/src/lib/browser.ts +34 -0
  183. package/src/lib/classBuilder.ts +137 -0
  184. package/src/lib/core.ts +182 -0
  185. package/src/lib/index.ts +116 -0
  186. package/src/nodeWriterElectron.ts +71 -0
  187. package/src/preload.ts +23 -21
  188. package/src/report.html.ts +29 -0
  189. package/src/web.html.ts +20 -0
  190. package/tests/Rectangle.test.ts +189 -0
  191. package/tsconfig.json +19 -6
  192. package/tsconfig.module.json +15 -4
  193. package/tsconfig.types.json +14 -4
  194. package/yarn-error.log +3144 -0
  195. package/dist/common/core.js +0 -397
  196. package/dist/common/subPackages/react/jsx/index.js +0 -26
  197. package/dist/common/subPackages/react-dom/jsx/node.js +0 -95
  198. package/dist/common/subPackages/react-test-renderer/component/node.js +0 -8
  199. package/dist/common/subPackages/react-test-renderer/component/web.js +0 -8
  200. package/dist/module/Report.js +0 -186
  201. package/dist/module/core.js +0 -388
  202. package/dist/module/subPackages/react/jsx/index.js +0 -22
  203. package/dist/module/subPackages/react/jsx/node.js +0 -5
  204. package/dist/module/subPackages/react/jsx/web.js +0 -5
  205. package/dist/module/subPackages/react-dom/jsx/node.js +0 -87
  206. package/dist/module/subPackages/react-test-renderer/jsx/web.js +0 -5
  207. package/dist/module/subPackages/react-test-renderer/jsx-promised/node.js +0 -5
  208. package/dist/types/core.d.ts +0 -220
  209. package/dist/types/subPackages/react/component/node.d.ts +0 -12
  210. package/dist/types/subPackages/react/component/web.d.ts +0 -12
  211. package/dist/types/subPackages/react/jsx/index.d.ts +0 -15
  212. package/dist/types/subPackages/react/jsx/node.d.ts +0 -4
  213. package/dist/types/subPackages/react/jsx/web.d.ts +0 -4
  214. package/dist/types/subPackages/react-dom/component/web.d.ts +0 -19
  215. package/dist/types/subPackages/react-dom/jsx/node.d.ts +0 -8
  216. package/dist/types/subPackages/react-dom/jsx/web.d.ts +0 -5
  217. package/dist/types/subPackages/react-test-renderer/MemoExoticComponent/node.d.ts +0 -8
  218. package/dist/types/subPackages/react-test-renderer/component/node.d.ts +0 -9
  219. package/dist/types/subPackages/react-test-renderer/component/web.d.ts +0 -9
  220. package/dist/types/subPackages/react-test-renderer/fc/node.d.ts +0 -9
  221. package/dist/types/subPackages/react-test-renderer/fc/web.d.ts +0 -9
  222. package/dist/types/subPackages/react-test-renderer/jsx/node.d.ts +0 -4
  223. package/dist/types/subPackages/react-test-renderer/jsx/web.d.ts +0 -4
  224. package/dist/types/subPackages/react-test-renderer/jsx-promised/node.d.ts +0 -4
  225. package/dist/types/subPackages/react-test-renderer/jsx-promised/web.d.ts +0 -4
  226. package/src/core.ts +0 -1399
  227. package/src/subPackages/react/component/web.ts +0 -80
  228. package/src/subPackages/react/jsx/index.ts +0 -64
  229. package/src/subPackages/react/jsx/node.ts +0 -29
  230. package/src/subPackages/react/jsx/web.ts +0 -29
  231. package/src/subPackages/react-dom/jsx/node.ts +0 -146
  232. package/src/subPackages/react-test-renderer/component/node.ts +0 -30
  233. package/src/subPackages/react-test-renderer/component/web.ts +0 -30
  234. package/src/subPackages/react-test-renderer/jsx/node.ts +0 -31
  235. package/src/subPackages/react-test-renderer/jsx/web.ts +0 -31
  236. package/src/subPackages/react-test-renderer/jsx-promised/node.ts +0 -31
  237. package/src/subPackages/react-test-renderer/jsx-promised/web.ts +0 -31
  238. /package/dist/common/{subPackages → SubPackages}/react-dom/jsx/index.js +0 -0
  239. /package/dist/common/{subPackages → SubPackages}/react-test-renderer/jsx-promised/web.js +0 -0
  240. /package/dist/module/{subPackages → SubPackages}/react-dom/jsx/index.js +0 -0
  241. /package/dist/module/{subPackages → SubPackages}/react-test-renderer/jsx-promised/web.js +0 -0
@@ -1,17 +1,17 @@
1
1
  import esbuild from "esbuild";
2
2
  import fs from "fs";
3
- import fsExists from "fs.promises.exists";
4
3
  import path from "path";
5
- import pm2 from "pm2";
6
4
  import readline from 'readline';
7
- import { WebSocketServer } from 'ws';
8
5
  import { glob } from "glob";
6
+ import esbuildNodeConfiger from "./esbuildConfigs/node.js";
7
+ import esbuildWebConfiger from "./esbuildConfigs/web.js";
8
+ import esbuildFeaturesConfiger from "./esbuildConfigs/features.js";
9
+ import webHtmlFrame from "./web.html.js";
10
+ import reportHtmlFrame from "./report.html.js";
11
+ import childProcess from 'child_process';
9
12
  readline.emitKeypressEvents(process.stdin);
10
13
  if (process.stdin.isTTY)
11
14
  process.stdin.setRawMode(true);
12
- const TIMEOUT = 2000;
13
- const OPEN_PORT = "";
14
- let webSocketServer;
15
15
  const getRunnables = (tests, payload = [new Set(), new Set()]) => {
16
16
  return tests.reduce((pt, cv, cndx, cry) => {
17
17
  if (cv[1] === "node") {
@@ -28,80 +28,9 @@ const getRunnables = (tests, payload = [new Set(), new Set()]) => {
28
28
  };
29
29
  export class ITProject {
30
30
  constructor(config) {
31
- this.exitCodes = {};
31
+ var _a;
32
32
  this.mode = `up`;
33
- this.ports = {};
34
- this.websockets = {};
35
- this.resourceQueue = [];
36
- this.spinCycle = 0;
37
- this.spinAnimation = "←↖↑↗→↘↓↙";
38
- this.mainLoop = async () => {
39
- if (this.clearScreen) {
40
- console.clear();
41
- }
42
- const procsTable = [];
43
- pm2.list((err, procs) => {
44
- procs.forEach((proc) => {
45
- var _a, _b;
46
- procsTable.push({
47
- name: proc.name,
48
- pid: proc.pid,
49
- pm_id: proc.pm_id,
50
- mem: (_a = proc.monit) === null || _a === void 0 ? void 0 : _a.memory,
51
- cpu: (_b = proc.monit) === null || _b === void 0 ? void 0 : _b.cpu,
52
- "exit code": this.exitCodes[proc.name]
53
- });
54
- });
55
- console.table(procsTable);
56
- console.table(this.resourceQueue);
57
- console.log("webSocketServer.clients", Object.keys(this.websockets));
58
- const resourceRequest = this.resourceQueue.pop();
59
- if (!resourceRequest) {
60
- if (!this.devMode && this.mode === "up") {
61
- this.initiateShutdown("resource request queue is empty");
62
- }
63
- if (this.mode === "down" &&
64
- (procsTable.every((p) => p.pid === 0 || p.pid === undefined) ||
65
- procsTable.length === 0)) {
66
- this.shutdown();
67
- }
68
- }
69
- else {
70
- if (resourceRequest.protocol === "ipc") {
71
- this.allocateViaIpc(resourceRequest);
72
- }
73
- else if (resourceRequest.protocol === "ws") {
74
- this.allocateViaWs(resourceRequest);
75
- }
76
- }
77
- const upMessage = "Running tests while watching for changes. Use 'q' to initiate shutdown and `x` to kill.";
78
- const downMessage = "Shutdown is in progress. Please wait.";
79
- if (this.devMode) {
80
- if (this.mode === "up") {
81
- console.log(this.spinner(), upMessage);
82
- }
83
- else {
84
- console.log(this.spinner(), downMessage);
85
- }
86
- }
87
- else {
88
- if (this.mode === "up") {
89
- console.log(this.spinner(), upMessage);
90
- }
91
- else {
92
- console.log(this.spinner(), downMessage);
93
- }
94
- }
95
- });
96
- };
97
- this.clearScreen = config.clearScreen;
98
- this.devMode = config.devMode;
99
- // mark each port as open
100
- Object.values(config.ports).forEach((port) => {
101
- this.ports[port] = OPEN_PORT;
102
- });
103
- const testPath = `${process.cwd()}/${config.tests}`;
104
- const featurePath = `${process.cwd()}/${config.features}`;
33
+ this.config = config;
105
34
  process.stdin.on('keypress', (str, key) => {
106
35
  if (key.name === 'q') {
107
36
  this.initiateShutdown("'q' command");
@@ -113,519 +42,279 @@ export class ITProject {
113
42
  process.exit(-1);
114
43
  }
115
44
  });
116
- import(testPath).then((tests) => {
117
- this.tests = tests.default;
118
- import(featurePath).then(async (features) => {
119
- this.features = features.default;
120
- await Promise.resolve(Promise.all([
121
- ...this.getSecondaryEndpointsPoints("web")
122
- ]
123
- .map(async (sourceFilePath) => {
124
- const sourceFileSplit = sourceFilePath.split("/");
125
- const sourceDir = sourceFileSplit.slice(0, -1);
126
- const sourceFileName = sourceFileSplit[sourceFileSplit.length - 1];
127
- const sourceFileNameMinusJs = sourceFileName.split(".").slice(0, -1).join(".");
128
- const htmlFilePath = path.normalize(`${process.cwd()}/${config.outdir}/${sourceDir.join("/")}/${sourceFileNameMinusJs}.html`);
129
- const jsfilePath = `./${sourceFileNameMinusJs}.mjs`;
130
- return fs.promises.mkdir(path.dirname(htmlFilePath), { recursive: true }).then(x => fs.writeFileSync(htmlFilePath, `
131
- <!DOCTYPE html>
132
- <html lang="en">
133
- <head>
134
- <script type="module" src="${jsfilePath}"></script>
135
- </head>
136
-
137
- <body>
138
- <h1>${htmlFilePath}</h1>
139
- <div id="root">
140
-
141
- </div>
142
- </body>
143
-
144
- <footer></footer>
145
-
146
- </html>
147
- `));
148
- })));
149
- const [nodeEntryPoints, webEntryPoints] = getRunnables(this.tests);
150
- const esbuildConfigNode = {
151
- define: {
152
- "process.env.FLUENTFFMPEG_COV": "0"
153
- },
154
- absWorkingDir: process.cwd(),
155
- banner: {
156
- js: `import { createRequire } from 'module';const require = createRequire(import.meta.url);`
157
- },
158
- target: "esnext",
159
- format: "esm",
160
- splitting: true,
161
- outExtension: { '.js': '.mjs' },
162
- platform: "node",
163
- external: [
164
- "tests.test.js",
165
- "features.test.js", "react"
166
- ],
167
- outbase: config.outbase,
168
- outdir: config.outdir,
169
- jsx: 'transform',
170
- entryPoints: [...nodeEntryPoints],
171
- bundle: true,
172
- minify: config.minify === true,
173
- write: true,
174
- loader: {
175
- '.js': 'jsx',
176
- '.png': 'binary',
177
- '.jpg': 'binary',
178
- },
179
- plugins: [
180
- ...(config.nodePlugins || []),
181
- {
182
- name: 'rebuild-notify',
183
- setup(build) {
184
- build.onEnd(result => {
185
- console.log(`node build ended with ${result.errors.length} errors`);
186
- console.log(result);
187
- result.errors.length !== 0 && process.exit(-1);
188
- });
189
- }
190
- },
191
- ],
192
- };
193
- const esbuildConfigWeb = {
194
- target: "esnext",
195
- format: "esm",
196
- splitting: true,
197
- outExtension: { '.js': '.mjs' },
198
- alias: {
199
- react: path.resolve("./node_modules/react")
200
- },
201
- external: [
202
- "tests.test.js",
203
- "features.test.js",
204
- // "url",
205
- // "react",
206
- "electron",
207
- "path",
208
- "fs",
209
- "stream",
210
- ],
211
- platform: "browser",
212
- outbase: config.outbase,
213
- outdir: config.outdir,
214
- jsx: 'transform',
215
- entryPoints: [
216
- ...webEntryPoints,
217
- testPath,
218
- featurePath,
219
- ],
220
- bundle: true,
221
- minify: config.minify === true,
222
- write: true,
223
- loader: {
224
- '.js': 'jsx',
225
- '.png': 'binary',
226
- '.jpg': 'binary',
227
- },
228
- plugins: [
229
- ...(config.webPlugins || []),
230
- {
231
- name: 'rebuild-notify',
232
- setup(build) {
233
- build.onEnd(result => {
234
- console.log(`web build ended with ${result.errors.length} errors`);
235
- console.log(result);
236
- result.errors.length !== 0 && process.exit(-1);
237
- });
238
- }
239
- },
240
- ],
241
- };
242
- glob('./dist/chunk-*.mjs', { ignore: 'node_modules/**' }).then((chunks) => {
243
- console.log("deleting chunks", chunks);
244
- chunks.forEach((chunk) => {
245
- console.log("deleting chunk", chunk);
246
- fs.unlinkSync(chunk);
247
- });
248
- });
249
- esbuild.build({
250
- bundle: true,
251
- entryPoints: ["./node_modules/testeranto/dist/module/Report.js"],
252
- minify: config.minify === true,
253
- outbase: config.outbase,
254
- write: true,
255
- outfile: `${config.outdir}/Report.js`,
256
- external: ["tests.test.js", "features.test.js"]
257
- });
258
- fs.writeFileSync(`${config.outdir}/report.html`, `
259
- <!DOCTYPE html>
260
- <html lang="en">
261
-
262
- <head>
263
- <meta name="description" content="Webpage description goes here" />
264
- <meta charset="utf-8" />
265
- <title>kokomoBay - testeranto</title>
266
- <meta name="viewport" content="width=device-width, initial-scale=1" />
267
- <meta name="author" content="" />
268
- <link rel="stylesheet" href="./Report.css" />
269
-
270
- <script type="importmap">
271
- {
272
- "imports": {
273
- "tests.test.js": "./tests.test.js",
274
- "features.test.js": "./features.test.js"
275
- }
276
- }
277
- </script>
278
-
279
-
280
- <script src="./Report.js"></script>
281
- </head>
282
-
283
- <body>
284
- <div id="root">
285
- react is loading
286
- </div>
287
- </body>
288
-
289
- </html>
290
- `);
291
- Promise.all([
292
- esbuild.context(esbuildConfigNode)
293
- .then(async (nodeContext) => {
294
- await nodeContext.watch();
295
- }),
296
- esbuild.context(esbuildConfigWeb)
297
- .then(async (esbuildWeb) => {
298
- await esbuildWeb.watch();
299
- })
300
- ]).then(() => {
301
- if (config.devMode === false) {
302
- console.log("Your tests were built but not run because devMode was false. Exiting gracefully");
303
- process.exit(0);
304
- }
305
- else {
306
- pm2.connect(async (err) => {
307
- if (err) {
308
- console.error(err);
309
- process.exit(-1);
310
- }
311
- else {
312
- console.log(`pm2 is connected`);
313
- }
314
- // run a websocket as an alternative to node IPC
315
- webSocketServer = new WebSocketServer({
316
- port: 8080,
317
- host: "localhost",
318
- });
319
- webSocketServer.on('open', () => {
320
- console.log('open');
321
- });
322
- webSocketServer.on('close', (data) => {
323
- console.log('webSocketServer close: %s', data);
324
- });
325
- webSocketServer.on('listening', () => {
326
- console.log("webSocketServer listening", webSocketServer.address());
327
- });
328
- webSocketServer.on('connection', (webSocket) => {
329
- webSocket.on('message', (webSocketData) => {
330
- const payload = JSON.parse(webSocketData.valueOf().toString());
331
- const messageType = payload.type;
332
- if (messageType === "testeranto:hola") {
333
- const name = payload.data.requirement.name;
334
- const requestedResources = payload.data;
335
- this.websockets[name] = webSocket;
336
- console.log('hola WS! connected: ' + name + ' in ' + Object.getOwnPropertyNames(this.websockets));
337
- this.requestResource(requestedResources.requirement, 'ws');
338
- }
339
- else if (messageType === "testeranto:adios") {
340
- console.log("adios WS", payload.data.testResourceConfiguration.name);
341
- this.releaseTestResourceWs(payload);
342
- }
343
- });
344
- });
345
- const makePath = (fPath, rt) => {
346
- return path.resolve("./" + config.outdir + "/" + fPath.replace(path.extname(fPath), "") + ".mjs");
347
- };
348
- const bootInterval = setInterval(async () => {
349
- const filesToLookup = this.tests
350
- .map(([p, rt]) => {
351
- const filepath = makePath(p, rt);
352
- return {
353
- filepath,
354
- exists: fsExists(filepath),
355
- };
356
- });
357
- const allFilesExist = (await Promise.all(filesToLookup.map((f) => f.exists))).every((b) => b);
358
- if (!allFilesExist) {
359
- console.log(this.spinner(), "waiting for files to build...");
360
- filesToLookup.forEach((f) => {
361
- console.log(f.exists, "\t", f.filepath);
362
- });
363
- }
364
- else {
365
- clearInterval(bootInterval);
366
- pm2.launchBus((err, pm2_bus) => {
367
- pm2_bus.on("testeranto:hola", (packet) => {
368
- this.requestResource(packet.data.requirement, 'ipc');
369
- });
370
- pm2_bus.on("testeranto:adios", (payload) => {
371
- this.releaseTestResourcePm2(payload.data);
372
- });
373
- });
374
- this
375
- .tests
376
- .reduce((m, [inputFilePath, runtime]) => {
377
- const script = makePath(inputFilePath, runtime);
378
- const partialTestResourceByCommandLineArg = `${script} '${JSON.stringify({
379
- name: inputFilePath,
380
- ports: [],
381
- fs: path.resolve(process.cwd(), config.outdir, inputFilePath),
382
- })}'`;
383
- if (runtime === "web") {
384
- const fileAsList = inputFilePath.split("/");
385
- const fileListHead = fileAsList.slice(0, -1);
386
- const fname = fileAsList[fileAsList.length - 1];
387
- const fnameOnly = fname.split(".").slice(0, -1).join(".");
388
- const htmlFile = [config.outdir, ...fileListHead, `${fnameOnly}.html`].join("/");
389
- const jsFile = path.resolve(htmlFile.split(".html")[0] + ".mjs");
390
- console.log("watching", jsFile);
391
- pm2.start({
392
- script: `yarn electron node_modules/testeranto/dist/common/electron.js ${htmlFile} '${JSON.stringify({
393
- scheduled: true,
394
- name: inputFilePath,
395
- ports: [],
396
- fs: path.resolve(process.cwd(), config.outdir, inputFilePath),
397
- })}'`,
398
- name: inputFilePath,
399
- autorestart: false,
400
- args: partialTestResourceByCommandLineArg,
401
- watch: [jsFile],
402
- }, (err, proc) => {
403
- if (err) {
404
- console.error(err);
405
- return pm2.disconnect();
406
- }
407
- });
408
- }
409
- else if (runtime === "node") {
410
- const resolvedPath = path.resolve(script);
411
- console.log("watching", resolvedPath);
412
- pm2.start({
413
- name: inputFilePath,
414
- script: `node ${resolvedPath} '${JSON.stringify({
415
- scheduled: true,
416
- name: inputFilePath,
417
- ports: [],
418
- fs: path.resolve(process.cwd(), config.outdir, inputFilePath),
419
- })}'`,
420
- autorestart: false,
421
- watch: [resolvedPath],
422
- args: partialTestResourceByCommandLineArg
423
- }, (err, proc) => {
424
- if (err) {
425
- console.error(err);
426
- return pm2.disconnect();
427
- }
428
- });
429
- }
430
- this.exitCodes[inputFilePath] = null;
431
- return [inputFilePath, ...m];
432
- }, []);
433
- setInterval(this.mainLoop, TIMEOUT).unref();
434
- }
435
- }, TIMEOUT).unref();
436
- });
437
- }
438
- });
45
+ const childElectron = childProcess.spawn("yarn", ["electron", "node_modules/testeranto/dist/common/electron.js"]);
46
+ // childElectron.stdout.on('data', function (msg) {
47
+ // console.log(msg.toString())
48
+ // });
49
+ const fileStream = fs.createWriteStream(`./${this.config.outdir}/electron.log`);
50
+ (_a = childElectron.stdout) === null || _a === void 0 ? void 0 : _a.pipe(fileStream);
51
+ Promise.resolve(Promise.all([
52
+ ...this.getSecondaryEndpointsPoints("web"),
53
+ ]
54
+ .map(async (sourceFilePath) => {
55
+ const sourceFileSplit = sourceFilePath.split("/");
56
+ const sourceDir = sourceFileSplit.slice(0, -1);
57
+ const sourceFileName = sourceFileSplit[sourceFileSplit.length - 1];
58
+ const sourceFileNameMinusJs = sourceFileName.split(".").slice(0, -1).join(".");
59
+ const htmlFilePath = path.normalize(`${process.cwd()}/${config.outdir}/web/${sourceDir.join("/")}/${sourceFileNameMinusJs}.html`);
60
+ const jsfilePath = `./${sourceFileNameMinusJs}.mjs`;
61
+ return fs.promises.mkdir(path.dirname(htmlFilePath), { recursive: true }).then(x => fs.writeFileSync(htmlFilePath, webHtmlFrame(jsfilePath, htmlFilePath)));
62
+ })));
63
+ const [nodeEntryPoints, webEntryPoints] = getRunnables(this.config.tests);
64
+ glob(`./${config.outdir}/chunk-*.mjs`, { ignore: 'node_modules/**' }).then((chunks) => {
65
+ console.log("deleting chunks", chunks);
66
+ chunks.forEach((chunk) => {
67
+ console.log("deleting chunk", chunk);
68
+ fs.unlinkSync(chunk);
439
69
  });
440
70
  });
441
- }
442
- requestResource(requirement, protocol) {
443
- this.resourceQueue.push({ requirement, protocol });
444
- }
445
- getSecondaryEndpointsPoints(runtime) {
446
- if (runtime) {
447
- return this.tests
448
- .filter((t) => {
449
- return (t[1] === runtime);
450
- })
451
- .map((tc) => tc[0]);
452
- }
453
- return this.tests
454
- .map((tc) => tc[0]);
455
- }
456
- initiateShutdown(reason) {
457
- console.log("Shutdown initiated because", reason);
458
- this.mode = "down";
459
- }
460
- shutdown() {
461
- let i = 0;
462
- new Promise((res, reh) => {
463
- console.log("final results: ");
464
- const procsTable = [];
465
- pm2.list((err, procs) => {
466
- procs.forEach((proc, ndx) => {
467
- const exitCode = this.exitCodes[proc.name];
468
- if (exitCode !== 0) {
469
- i++;
470
- }
471
- procsTable.push({
472
- name: proc.name,
473
- pm_id: proc.pm_id,
474
- exitCode
475
- });
476
- if (ndx === procs.length - 1) {
477
- console.table(procsTable);
478
- res(i);
479
- }
480
- });
71
+ fs.copyFileSync("node_modules/testeranto/dist/prebuild/report.js", "./docs/Report.js");
72
+ fs.copyFileSync("node_modules/testeranto/dist/prebuild/report.css", "./docs/Report.css");
73
+ fs.writeFileSync(`${config.outdir}/report.html`, reportHtmlFrame());
74
+ Promise.all([
75
+ esbuild.context(esbuildFeaturesConfiger(config))
76
+ .then(async (featuresContext) => {
77
+ console.log("features entry points", config.features);
78
+ await featuresContext.watch();
79
+ return featuresContext;
80
+ }),
81
+ esbuild.context(esbuildNodeConfiger(config, nodeEntryPoints))
82
+ .then(async (nodeContext) => {
83
+ console.log("node entry points", nodeEntryPoints);
84
+ await nodeContext.watch();
85
+ return nodeContext;
86
+ }),
87
+ esbuild.context(esbuildWebConfiger(config, webEntryPoints))
88
+ .then(async (esbuildWeb) => {
89
+ console.log("web entry points", webEntryPoints);
90
+ await esbuildWeb.watch();
91
+ return esbuildWeb;
92
+ }),
93
+ ]).then(async (contexts) => {
94
+ Promise.all(config.tests.map(async ([test, runtime]) => {
95
+ return {
96
+ test,
97
+ runtime
98
+ };
99
+ })).then(async (modules) => {
100
+ fs.writeFileSync(`${config.outdir}/testeranto.json`, JSON.stringify({
101
+ modules,
102
+ buildDir: process.cwd() + "/" + config.outdir
103
+ }, null, 2));
481
104
  });
482
- }).then((failures) => {
483
- pm2.stop("all", (e) => console.error(e));
484
- pm2.disconnect();
485
- console.log(`gracefully exiting with ${failures} failures`);
486
- process.exit(failures);
487
- });
488
- }
489
- spinner() {
490
- this.spinCycle = (this.spinCycle + 1) % this.spinAnimation.length;
491
- return this.spinAnimation[this.spinCycle];
492
- }
493
- async releaseTestResourceWs(payload) {
494
- const name = payload.data.testResourceConfiguration.name;
495
- const failed = payload.data.failed;
496
- this.exitCodes[name] = failed;
497
- Object.keys(this.ports).forEach((port) => {
498
- if (this.ports[port] === name) {
499
- this.ports[port] = OPEN_PORT;
105
+ if (config.devMode === false) {
106
+ console.log("Your tests were built but not run because devMode was false. Exiting gracefully");
107
+ process.exit(0);
108
+ }
109
+ else {
110
+ // no-op
500
111
  }
501
112
  });
502
113
  }
503
- async releaseTestResourcePm2(payload) {
504
- const name = payload.testResourceConfiguration.name;
505
- const failed = payload.failed;
506
- this.exitCodes[name] = failed;
507
- pm2.list((err, processes) => {
508
- processes.forEach((proc) => {
509
- if (proc.name === name) {
510
- Object.keys(this.ports).forEach((port) => {
511
- if (this.ports[port] === name) {
512
- this.ports[port] = OPEN_PORT;
513
- }
514
- });
515
- }
516
- });
517
- });
518
- }
519
- allocateViaWs(resourceRequest) {
520
- const name = resourceRequest.requirement.name;
521
- const testResourceRequirement = resourceRequest.requirement;
522
- const websocket = this.websockets[name];
523
- if ((testResourceRequirement === null || testResourceRequirement === void 0 ? void 0 : testResourceRequirement.ports) === 0) {
524
- websocket.send(JSON.stringify({
525
- data: {
526
- testResourceConfiguration: {
527
- ports: [],
528
- },
114
+ getSecondaryEndpointsPoints(runtime) {
115
+ const meta = (ts, st) => {
116
+ ts.forEach((t) => {
117
+ if (t[1] === runtime) {
118
+ st.add(t[0]);
529
119
  }
530
- }));
531
- }
532
- else if (((testResourceRequirement === null || testResourceRequirement === void 0 ? void 0 : testResourceRequirement.ports) || 0) > 0) {
533
- // clear any port-slots associated with this job
534
- Object.values(this.ports).forEach((jobMaybe, portNumber) => {
535
- if (jobMaybe && jobMaybe === name) {
536
- this.ports[portNumber] = OPEN_PORT;
120
+ if (Array.isArray(t[2])) {
121
+ meta(t[2], st);
537
122
  }
538
123
  });
539
- // find a list of open ports
540
- const foundOpenPorts = Object.keys(this.ports).filter((p) => this.ports[p] === OPEN_PORT);
541
- if (foundOpenPorts.length >= testResourceRequirement.ports) {
542
- const selectionOfPorts = foundOpenPorts.slice(0, testResourceRequirement.ports);
543
- websocket.send(JSON.stringify({
544
- data: {
545
- testResourceConfiguration: {
546
- ports: selectionOfPorts,
547
- },
548
- }
549
- }));
550
- // mark the selected ports as occupied
551
- for (const foundOpenPort of selectionOfPorts) {
552
- this.ports[foundOpenPort] = name;
553
- }
554
- }
555
- else {
556
- console.log(`no port was open so send the ${name} job to the back of the resourceQueue`);
557
- this.resourceQueue.push(resourceRequest);
558
- }
559
- }
124
+ return st;
125
+ };
126
+ return Array.from(meta(this.config.tests, new Set()));
560
127
  }
561
- allocateViaIpc(resourceRequest) {
562
- const pName = resourceRequest.requirement.name;
563
- const testResourceRequirement = resourceRequest.requirement;
564
- pm2.list((err, processes) => {
565
- console.error(err);
566
- processes.forEach((p) => {
567
- if (p.name === pName && p.pid) {
568
- const message = {
569
- // these fields must be present
570
- id: p.pid,
571
- topic: "some topic",
572
- type: "process:msg",
573
- // Data to be sent
574
- data: {
575
- testResourceConfiguration: {
576
- ports: [],
577
- // fs: fPath,
578
- },
579
- id: p.pm_id,
580
- },
581
- };
582
- if ((testResourceRequirement === null || testResourceRequirement === void 0 ? void 0 : testResourceRequirement.ports) === 0) {
583
- pm2.sendDataToProcessId(p.pm_id, message, function (err, res) {
584
- // console.log("sendDataToProcessId", err, res, message);
585
- });
586
- }
587
- if (((testResourceRequirement === null || testResourceRequirement === void 0 ? void 0 : testResourceRequirement.ports) || 0) > 0) {
588
- // clear any port-slots associated with this job
589
- Object.values(this.ports).forEach((jobMaybe, portNumber) => {
590
- if (jobMaybe && jobMaybe === pName) {
591
- this.ports[portNumber] = OPEN_PORT;
592
- }
593
- });
594
- // find a list of open ports
595
- const foundOpenPorts = Object.keys(this.ports).filter((p) => this.ports[p] === OPEN_PORT);
596
- // if there are enough open port-slots...
597
- if (foundOpenPorts.length >= testResourceRequirement.ports) {
598
- const selectionOfPorts = foundOpenPorts.slice(0, testResourceRequirement.ports);
599
- const message = {
600
- // these fields must be present
601
- id: p.pid,
602
- topic: "some topic",
603
- // process:msg will be send as 'message' on target process
604
- type: "process:msg",
605
- // Data to be sent
606
- data: {
607
- testResourceConfiguration: {
608
- // fs: fPath,
609
- ports: selectionOfPorts,
610
- },
611
- id: p.pid,
612
- },
613
- };
614
- pm2.sendDataToProcessId(p.pm_id, message, function (err, res) {
615
- // no-op
616
- });
617
- // mark the selected ports as occupied
618
- for (const foundOpenPort of selectionOfPorts) {
619
- this.ports[foundOpenPort] = p.pid.toString();
620
- }
621
- }
622
- else {
623
- console.log(`no port was open so send the ${p.pid} job to the back of the resourceQueue`);
624
- this.resourceQueue.push(resourceRequest);
625
- }
626
- }
627
- }
628
- });
629
- });
128
+ initiateShutdown(reason) {
129
+ console.log("Shutdown initiated because", reason);
130
+ this.mode = "down";
630
131
  }
631
132
  }
133
+ // pm2.connect(async (err) => {
134
+ // if (err) {
135
+ // console.error(err);
136
+ // process.exit(-1);
137
+ // } else {
138
+ // console.log(`pm2 is connected`);
139
+ // }
140
+ // // run a websocket as an alternative to node IPC
141
+ // webSocketServer = new WebSocketServer({
142
+ // port: 8080,
143
+ // host: "localhost",
144
+ // });
145
+ // webSocketServer.on('open', () => {
146
+ // console.log('open');
147
+ // });
148
+ // webSocketServer.on('close', (data) => {
149
+ // console.log('webSocketServer close: %s', data);
150
+ // });
151
+ // webSocketServer.on('listening', () => {
152
+ // console.log("webSocketServer listening", webSocketServer.address());
153
+ // });
154
+ // webSocketServer.on('connection', (webSocket: WebSocket) => {
155
+ // webSocket.on('message', (webSocketData) => {
156
+ // const payload = JSON.parse(webSocketData.valueOf().toString() as any);
157
+ // const messageType = payload.type;
158
+ // if (messageType === "testeranto:hola") {
159
+ // const name = payload.data.requirement.name;
160
+ // const requestedResources = payload.data;
161
+ // this.websockets[name] = webSocket
162
+ // console.log('hola WS! connected: ' + name + ' in ' + Object.getOwnPropertyNames(this.websockets))
163
+ // this.requestResource(requestedResources.requirement, 'ws');
164
+ // } else if (messageType === "testeranto:adios") {
165
+ // console.log("adios WS", payload.data.testResourceConfiguration.name);
166
+ // this.releaseTestResourceWs(payload as any);
167
+ // }
168
+ // });
169
+ // });
170
+ // const makePath = (fPath: string, rt: IRunTime): string => {
171
+ // return path.resolve("./" + config.outdir + "/" +
172
+ // rt +
173
+ // // (rt === "electron" || rt === "chromium" ? "web" : "node") +
174
+ // "/" + fPath.replace(path.extname(fPath), "") + ".mjs");
175
+ // };
176
+ // const bootInterval = setInterval(async () => {
177
+ // const filesToLookup = this.tests
178
+ // .map(([p, rt]) => {
179
+ // const filepath = makePath(p, rt);
180
+ // return {
181
+ // filepath,
182
+ // exists: fsExists(filepath),
183
+ // };
184
+ // });
185
+ // const allFilesExist = (
186
+ // await Promise.all(filesToLookup.map((f) => f.exists))
187
+ // ).every((b) => b);
188
+ // if (!allFilesExist) {
189
+ // console.log(this.spinner(), "waiting for files to build...")
190
+ // filesToLookup.forEach((f) => {
191
+ // console.log(f.exists, "\t", f.filepath);
192
+ // })
193
+ // } else {
194
+ // clearInterval(bootInterval);
195
+ // pm2.launchBus((err, pm2_bus) => {
196
+ // pm2_bus.on("testeranto:hola", (packet: { data: { requirement: ITTestResourceRequirement } }) => {
197
+ // this.requestResource(
198
+ // packet.data.requirement,
199
+ // 'ipc'
200
+ // );
201
+ // });
202
+ // pm2_bus.on("testeranto:adios", (payload: IAdiosIPC) => {
203
+ // this.releaseTestResourcePm2(payload.data);
204
+ // });
205
+ // });
206
+ // this
207
+ // .tests
208
+ // .reduce((m, [inputFilePath, runtime]) => {
209
+ // const script = makePath(inputFilePath, runtime);
210
+ // const partialTestResourceByCommandLineArg = `${script} '${JSON.stringify(
211
+ // {
212
+ // name: inputFilePath,
213
+ // ports: [],
214
+ // fs: path.resolve(
215
+ // process.cwd(),
216
+ // config.outdir,
217
+ // inputFilePath
218
+ // ),
219
+ // }
220
+ // )}'`;
221
+ // if (runtime === "web") {
222
+ // pm2.start(electron_pm2_StartOptions(
223
+ // partialTestResourceByCommandLineArg,
224
+ // inputFilePath,
225
+ // config
226
+ // ),
227
+ // (err, proc) => {
228
+ // if (err) {
229
+ // console.error(err);
230
+ // return pm2.disconnect();
231
+ // }
232
+ // }
233
+ // );
234
+ // // } else if (runtime === "chromium") {
235
+ // // pm2.start(
236
+ // // chromium_pm2_StartOptions(
237
+ // // partialTestResourceByCommandLineArg,
238
+ // // inputFilePath,
239
+ // // config,
240
+ // // ),
241
+ // // (err, proc) => {
242
+ // // if (err) {
243
+ // // console.error(err);
244
+ // // return pm2.disconnect();
245
+ // // }
246
+ // // }
247
+ // // );
248
+ // } else if (runtime === "node") {
249
+ // const resolvedPath = path.resolve(script);
250
+ // console.log("watching", resolvedPath);
251
+ // pm2.start(node_pm2_StartOptions(
252
+ // partialTestResourceByCommandLineArg,
253
+ // inputFilePath,
254
+ // config,
255
+ // resolvedPath
256
+ // ), (err, proc) => {
257
+ // if (err) {
258
+ // console.error(err);
259
+ // return pm2.disconnect();
260
+ // }
261
+ // });
262
+ // }
263
+ // this.exitCodes[inputFilePath] = null;
264
+ // return [inputFilePath, ...m];
265
+ // }, []);
266
+ // setInterval(this.mainLoop, TIMEOUT).unref();
267
+ // }
268
+ // }, TIMEOUT).unref();
269
+ // });
270
+ // public requestResource(
271
+ // requirement: ITTestResourceRequirement,
272
+ // protocol: ISchedulerProtocols
273
+ // ) {
274
+ // this.resourceQueue.push({ requirement, protocol });
275
+ // }
276
+ // const OPEN_PORT = "";
277
+ // type ISchedulerProtocols = `ipc` | `ws`;
278
+ // type IAdios = {
279
+ // name: string;
280
+ // failed: any;
281
+ // testResourceConfiguration: {
282
+ // name: string;
283
+ // };
284
+ // results: {
285
+ // fails: any[];
286
+ // givens: any[];
287
+ // name: string;
288
+ // };
289
+ // };
290
+ // type IAdiosIPC = {
291
+ // process: {
292
+ // namespace: string;
293
+ // versioning: object;
294
+ // name: string;
295
+ // pm_id: number;
296
+ // };
297
+ // data: IAdios
298
+ // at: string;
299
+ // };
300
+ // clearScreen: boolean;
301
+ // devMode: boolean;
302
+ // exitCodes: Record<number, string> = {};
303
+ // features: TesterantoFeatures;
304
+ // ports: Record<string, string> = {};
305
+ // tests: ITestTypes[];
306
+ // websockets: Record<string, WebSocket> = {};
307
+ // resourceQueue: {
308
+ // requirement: ITTestResourceRequirement,
309
+ // protocol: ISchedulerProtocols,
310
+ // }[] = [];
311
+ // private spinCycle = 0;
312
+ // private spinAnimation = "←↖↑↗→↘↓↙";
313
+ // console.log("sending", JSON.stringify(this.tests));
314
+ // childElectron.stdin.write(JSON.stringify(this.tests));
315
+ // not necessary
316
+ // this.esWebServerDetails = await eWeb.serve({
317
+ // servedir: jsonConfig.outdir,
318
+ // });
319
+ // fs.copyFileSync("node_modules/testeranto/dist/index.css", "index.css")
320
+ //