testeranto 0.172.0 → 0.177.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.
- package/README.md +2 -4
- package/dist/common/src/PM/base.js +5 -1
- package/dist/common/src/PM/main.js +57 -54
- package/dist/common/src/PM/node.js +4 -1
- package/dist/common/src/PM/pure.js +4 -1
- package/dist/common/src/PM/web.js +6 -3
- package/dist/common/src/Pure.js +0 -4
- package/dist/common/src/Pure.test.js +1 -1
- package/dist/common/src/ReportServer.js +2 -126
- package/dist/common/src/ReportServer.test.ts/index.js +78 -0
- package/dist/common/src/ReportServerLib.js +141 -0
- package/dist/common/src/components/pure/ProjectPageView.test/implementation.js +1 -1
- package/dist/common/src/esbuildConfigs/node.js +1 -3
- package/dist/common/src/lib/BaseSuite.js +13 -11
- package/dist/common/src/lib/abstractBase.js +39 -40
- package/dist/common/src/lib/baseBuilder.test/baseBuilder.test.implementation.js +10 -9
- package/dist/common/src/lib/baseBuilder.test/baseBuilder.test.specification.js +7 -7
- package/dist/common/src/lib/basebuilder.js +13 -2
- package/dist/common/src/lib/core.js +1 -0
- package/dist/common/src/lib/pmProxy.js +215 -201
- package/dist/common/src/lib/pmProxy.test/adapter.js +2 -2
- package/dist/common/src/lib/pmProxy.test/implementation.js +1 -1
- package/dist/common/testeranto.config.js +47 -32
- package/dist/common/tsconfig.common.tsbuildinfo +1 -1
- package/dist/module/src/PM/base.js +5 -1
- package/dist/module/src/PM/main.js +22 -19
- package/dist/module/src/PM/node.js +4 -1
- package/dist/module/src/PM/pure.js +4 -1
- package/dist/module/src/PM/web.js +6 -3
- package/dist/module/src/Pure.js +0 -4
- package/dist/module/src/Pure.test.js +1 -1
- package/dist/module/src/ReportServer.js +2 -123
- package/dist/module/src/ReportServer.test.ts/index.js +73 -0
- package/dist/module/src/ReportServerLib.js +134 -0
- package/dist/module/src/TestPage.js +29 -17
- package/dist/module/src/components/pure/ProjectPageView.test/implementation.js +1 -1
- package/dist/module/src/components/pure/TestPageView.js +29 -17
- package/dist/module/src/esbuildConfigs/node.js +1 -3
- package/dist/module/src/lib/BaseSuite.js +13 -11
- package/dist/module/src/lib/abstractBase.js +39 -40
- package/dist/module/src/lib/baseBuilder.test/baseBuilder.test.implementation.js +10 -9
- package/dist/module/src/lib/baseBuilder.test/baseBuilder.test.specification.js +7 -7
- package/dist/module/src/lib/basebuilder.js +13 -2
- package/dist/module/src/lib/core.js +1 -0
- package/dist/module/src/lib/pmProxy.js +215 -201
- package/dist/module/src/lib/pmProxy.test/adapter.js +2 -2
- package/dist/module/src/lib/pmProxy.test/implementation.js +1 -1
- package/dist/module/testeranto.config.js +47 -32
- package/dist/module/tsconfig.module.tsbuildinfo +1 -1
- package/dist/prebuild/App.js +3 -3
- package/dist/prebuild/ReportServer.mjs +21 -9
- package/dist/prebuild/build.mjs +1 -1
- package/dist/prebuild/run.mjs +27 -20
- package/dist/types/src/PM/base.d.ts +1 -1
- package/dist/types/src/PM/node.d.ts +1 -1
- package/dist/types/src/PM/pure.d.ts +1 -1
- package/dist/types/src/PM/web.d.ts +1 -1
- package/dist/types/src/ReportServer.test.ts/index.d.ts +29 -0
- package/dist/types/src/ReportServerLib.d.ts +1 -0
- package/dist/types/src/Types.d.ts +0 -1
- package/dist/types/src/components/pure/ProjectPageView.test/index.d.ts +2 -1
- package/dist/types/src/lib/BaseSuite.d.ts +2 -0
- package/dist/types/src/lib/abstractBase.d.ts +5 -7
- package/dist/types/src/lib/baseBuilder.test/baseBuilder.test.types.d.ts +7 -4
- package/dist/types/src/lib/pmProxy.d.ts +3 -3
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/PM/base.ts +7 -5
- package/src/PM/main.ts +26 -21
- package/src/PM/node.ts +6 -1
- package/src/PM/pure.ts +6 -1
- package/src/PM/web.ts +7 -3
- package/src/Pure.test.ts +6 -6
- package/src/Pure.ts +0 -8
- package/src/ReportServer.test.ts/index.ts +194 -0
- package/src/ReportServer.ts +2 -132
- package/src/ReportServerLib.ts +147 -0
- package/src/TestPage.tsx +65 -5
- package/src/Types.ts +0 -1
- package/src/components/pure/ProjectPageView.test/implementation.tsx +1 -1
- package/src/components/pure/TestPageView.tsx +65 -5
- package/src/esbuildConfigs/node.ts +1 -1
- package/src/lib/BaseSuite.ts +16 -21
- package/src/lib/abstractBase.ts +59 -48
- package/src/lib/baseBuilder.test/baseBuilder.test.implementation.ts +22 -10
- package/src/lib/baseBuilder.test/baseBuilder.test.specification.ts +9 -9
- package/src/lib/baseBuilder.test/baseBuilder.test.types.ts +7 -4
- package/src/lib/basebuilder.ts +13 -4
- package/src/lib/core.ts +1 -0
- package/src/lib/pmProxy.test/adapter.ts +2 -2
- package/src/lib/pmProxy.test/implementation.ts +3 -3
- package/src/lib/pmProxy.test/types.ts +0 -2
- package/src/lib/pmProxy.ts +135 -80
- package/testeranto/App.js +3 -3
- package/testeranto/bundles/node/core/metafile.json +8 -0
- package/testeranto/bundles/pure/core/metafile.json +8 -0
- package/testeranto/bundles/web/core/metafile.json +15086 -0
- package/testeranto/bundles/web/{allTests → core}/src/components/pure/ProjectPageView.test/index.html +1 -1
- package/testeranto/bundles/web/{allTests → core}/src/components/pure/ProjectPageView.test/index.mjs +4109 -1642
- package/testeranto/projects.json +1 -1
- package/testeranto/reports/core/config.json +24 -0
- package/testeranto/reports/{allTests → core}/src/components/pure/ProjectPageView.test/index/web/lint_errors.txt +6 -1
- package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/logs.txt +59 -0
- package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/message.txt +2 -0
- package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/prompt.txt +27 -0
- package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/suite-0/given-basicRender/then-0/butThen/happyPath.png +0 -0
- package/testeranto/reports/{allTests → core}/src/components/pure/ProjectPageView.test/index/web/type_errors.txt +15 -33
- package/testeranto/reports/core/summary.json +9 -0
- package/testeranto.config.ts +49 -32
- package/tsc.log +78 -92
- package/testeranto/bundles/node/allTests/chunk-3EUGBAOM.mjs +0 -113
- package/testeranto/bundles/node/allTests/chunk-E75CSRER.mjs +0 -800
- package/testeranto/bundles/node/allTests/chunk-M6DO7VMB.mjs +0 -252
- package/testeranto/bundles/node/allTests/metafile.json +0 -1229
- package/testeranto/bundles/node/allTests/src/lib/BaseSuite.test/node.test.mjs +0 -323
- package/testeranto/bundles/node/allTests/src/lib/baseBuilder.test/baseBuilder.test.node.mjs +0 -223
- package/testeranto/bundles/node/allTests/src/lib/classBuilder.test/classBuilder.test.mjs +0 -411
- package/testeranto/bundles/node/allTests/src/lib/core.test/core.test.mjs +0 -528
- package/testeranto/bundles/node/allTests/src/lib/pmProxy.test/index.mjs +0 -4752
- package/testeranto/bundles/pure/allTests/chunk-KHDVEHF7.mjs +0 -185
- package/testeranto/bundles/pure/allTests/chunk-VMUSFSZM.mjs +0 -797
- package/testeranto/bundles/pure/allTests/metafile.json +0 -1054
- package/testeranto/bundles/pure/allTests/src/Pure.test.mjs +0 -429
- package/testeranto/bundles/pure/allTests/src/lib/BaseSuite.test/pure.test.mjs +0 -425
- package/testeranto/bundles/pure/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure.mjs +0 -381
- package/testeranto/bundles/web/allTests/chunk-HPYA4YZC.mjs +0 -2283
- package/testeranto/bundles/web/allTests/chunk-U7AW26HL.mjs +0 -997
- package/testeranto/bundles/web/allTests/metafile.json +0 -25
- package/testeranto/bundles/web/allTests/src/lib/BaseSuite.test/web.test.html +0 -19
- package/testeranto/bundles/web/allTests/src/lib/BaseSuite.test/web.test.mjs +0 -440
- package/testeranto/bundles/web/allTests/src/lib/baseBuilder.test/baseBuilder.test.web.html +0 -19
- package/testeranto/bundles/web/allTests/src/lib/baseBuilder.test/baseBuilder.test.web.mjs +0 -244
- package/testeranto/reports/allTests/config.json +0 -104
- package/testeranto/reports/allTests/src/Pure.test/pure/lint_errors.txt +0 -0
- package/testeranto/reports/allTests/src/Pure.test/pure/message.txt +0 -2
- package/testeranto/reports/allTests/src/Pure.test/pure/prompt.txt +0 -13
- package/testeranto/reports/allTests/src/Pure.test/pure/type_errors.txt +0 -101
- package/testeranto/reports/allTests/src/components/pure/ProjectPageView.test/index/web/bdd_errors.txt +0 -1
- package/testeranto/reports/allTests/src/components/pure/ProjectPageView.test/index/web/logs.txt +0 -50
- package/testeranto/reports/allTests/src/components/pure/ProjectPageView.test/index/web/message.txt +0 -2
- package/testeranto/reports/allTests/src/components/pure/ProjectPageView.test/index/web/prompt.txt +0 -17
- package/testeranto/reports/allTests/src/components/pure/ProjectPageView.test/index/web/tests.json +0 -32
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/node.test/node/bdd_errors.txt +0 -1
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/node.test/node/lint_errors.txt +0 -0
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/node.test/node/logs.txt +0 -52
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/node.test/node/message.txt +0 -2
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/node.test/node/prompt.txt +0 -13
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/node.test/node/tests.json +0 -31
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/node.test/node/type_errors.txt +0 -111
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/pure.test/pure/bdd_errors.txt +0 -1
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/pure.test/pure/lint_errors.txt +0 -0
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/pure.test/pure/message.txt +0 -2
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/pure.test/pure/prompt.txt +0 -14
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/pure.test/pure/tests.json +0 -31
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/pure.test/pure/type_errors.txt +0 -111
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/web.test/web/bdd_errors.txt +0 -1
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/web.test/web/lint_errors.txt +0 -0
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/web.test/web/logs.txt +0 -108
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/web.test/web/message.txt +0 -2
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/web.test/web/prompt.txt +0 -14
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/web.test/web/tests.json +0 -31
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/web.test/web/type_errors.txt +0 -111
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/bdd_errors.txt +0 -1
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/lint_errors.txt +0 -0
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/logs.txt +0 -35
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/message.txt +0 -2
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/prompt.txt +0 -16
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/tests.json +0 -77
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/type_errors.txt +0 -62
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/lint_errors.txt +0 -0
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/message.txt +0 -2
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/prompt.txt +0 -18
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/type_errors.txt +0 -62
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/bdd_errors.txt +0 -1
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/lint_errors.txt +0 -0
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/logs.txt +0 -69
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/message.txt +0 -2
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/prompt.txt +0 -16
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/tests.json +0 -77
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/type_errors.txt +0 -62
- package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/bdd_errors.txt +0 -1
- package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/lint_errors.txt +0 -0
- package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/logs.txt +0 -700
- package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/message.txt +0 -2
- package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/prompt.txt +0 -16
- package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/tests.json +0 -164
- package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/type_errors.txt +0 -138
- package/testeranto/reports/allTests/src/lib/core.test/core.test/node/lint_errors.txt +0 -21
- package/testeranto/reports/allTests/src/lib/core.test/core.test/node/logs.txt +0 -7
- package/testeranto/reports/allTests/src/lib/core.test/core.test/node/message.txt +0 -2
- package/testeranto/reports/allTests/src/lib/core.test/core.test/node/prompt.txt +0 -18
- package/testeranto/reports/allTests/src/lib/core.test/core.test/node/type_errors.txt +0 -63
- package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/bdd_errors.txt +0 -1
- package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/lint_errors.txt +0 -20
- package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/logs.txt +0 -31
- package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/message.txt +0 -2
- package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/prompt.txt +0 -16
- package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/tests.json +0 -134
- package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/type_errors.txt +0 -76
- package/testeranto/reports/allTests/summary.json +0 -79
- package/testeranto/reportsnode_build_errors +0 -20
- package/testeranto/reportspure_build_errors +0 -343
- package/testeranto/reportsweb_build_errors +0 -25
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "testeranto",
|
|
3
3
|
"description": "the AI powered BDD test framework for typescript projects",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.177.0",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": "18.18.0"
|
|
7
7
|
},
|
|
@@ -155,7 +155,7 @@
|
|
|
155
155
|
"@swc/core": "^1.3.26",
|
|
156
156
|
"@types/express": "^5.0.0",
|
|
157
157
|
"@types/express-session": "^1.18.1",
|
|
158
|
-
"@types/node": "^
|
|
158
|
+
"@types/node": "^24.1.0",
|
|
159
159
|
"@types/react": "18.2.0",
|
|
160
160
|
"@types/react-dom": "18.2.0",
|
|
161
161
|
"@types/react-test-renderer": "19.0.0",
|
|
@@ -165,7 +165,7 @@
|
|
|
165
165
|
"@typescript-eslint/parser": "^5.46.0",
|
|
166
166
|
"marked": "^12.0.2",
|
|
167
167
|
"self-import": "*",
|
|
168
|
-
"testeranto-react": "0.0.
|
|
168
|
+
"testeranto-react": "0.0.8",
|
|
169
169
|
"ts-node": "^10.9.1",
|
|
170
170
|
"typescript": "^5.8.2"
|
|
171
171
|
},
|
package/src/PM/base.ts
CHANGED
|
@@ -162,11 +162,13 @@ export abstract class PM_Base {
|
|
|
162
162
|
return false;
|
|
163
163
|
}
|
|
164
164
|
|
|
165
|
-
async writeFileSync(
|
|
166
|
-
filepath
|
|
167
|
-
contents
|
|
168
|
-
testName
|
|
169
|
-
|
|
165
|
+
async writeFileSync(...x): Promise<boolean> {
|
|
166
|
+
const filepath = x[0];
|
|
167
|
+
const contents = x[1];
|
|
168
|
+
const testName = x[2];
|
|
169
|
+
|
|
170
|
+
console.log("writing file", filepath);
|
|
171
|
+
|
|
170
172
|
return new Promise<boolean>(async (res) => {
|
|
171
173
|
fs.mkdirSync(path.dirname(filepath), {
|
|
172
174
|
recursive: true,
|
package/src/PM/main.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
4
4
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
5
5
|
import { ChildProcess, spawn } from "node:child_process";
|
|
6
|
-
|
|
6
|
+
import ansiColors from "ansi-colors";
|
|
7
7
|
import net from "net";
|
|
8
8
|
import { Page } from "puppeteer-core/lib/esm/puppeteer";
|
|
9
9
|
import fs, { watch } from "fs";
|
|
@@ -21,8 +21,8 @@ import { getRunnables } from "../utils";
|
|
|
21
21
|
import { IBuiltConfig, IRunTime, ITestTypes } from "../Types.js";
|
|
22
22
|
import { Sidecar } from "../lib/Sidecar.js";
|
|
23
23
|
import { Queue } from "../utils/queue.js";
|
|
24
|
+
|
|
24
25
|
import { PM_WithEslintAndTsc } from "./PM_WithEslintAndTsc.js";
|
|
25
|
-
import ansiColors from "ansi-colors";
|
|
26
26
|
|
|
27
27
|
type IOutputs = Record<
|
|
28
28
|
string,
|
|
@@ -242,9 +242,9 @@ export class PM_Main extends PM_WithEslintAndTsc {
|
|
|
242
242
|
slowMo: 1,
|
|
243
243
|
waitForInitialPage: false,
|
|
244
244
|
executablePath,
|
|
245
|
-
headless:
|
|
245
|
+
headless: true,
|
|
246
246
|
dumpio: false,
|
|
247
|
-
devtools:
|
|
247
|
+
devtools: false,
|
|
248
248
|
|
|
249
249
|
args: [
|
|
250
250
|
"--disable-features=site-per-process",
|
|
@@ -717,7 +717,12 @@ export class PM_Main extends PM_WithEslintAndTsc {
|
|
|
717
717
|
const child = spawn(
|
|
718
718
|
"node",
|
|
719
719
|
// "node",
|
|
720
|
-
[
|
|
720
|
+
[
|
|
721
|
+
// "--inspect-brk",
|
|
722
|
+
builtfile,
|
|
723
|
+
testResources,
|
|
724
|
+
ipcfile,
|
|
725
|
+
],
|
|
721
726
|
{
|
|
722
727
|
stdio: ["pipe", "pipe", "pipe", "ipc"],
|
|
723
728
|
}
|
|
@@ -1245,17 +1250,6 @@ export class PM_Main extends PM_WithEslintAndTsc {
|
|
|
1245
1250
|
|
|
1246
1251
|
const d = `${dest}?cacheBust=${Date.now()}`;
|
|
1247
1252
|
|
|
1248
|
-
const evaluation = `
|
|
1249
|
-
|
|
1250
|
-
import('${d}').then(async (x) => {
|
|
1251
|
-
|
|
1252
|
-
try {
|
|
1253
|
-
return await (await x.default).receiveTestResourceConfig(${webArgz})
|
|
1254
|
-
} catch (e) {
|
|
1255
|
-
console.log("web run failure", e.toString())
|
|
1256
|
-
}
|
|
1257
|
-
})`;
|
|
1258
|
-
|
|
1259
1253
|
const ofile = `${reportDest}/logs.txt`;
|
|
1260
1254
|
const oStream = fs.createWriteStream(ofile);
|
|
1261
1255
|
|
|
@@ -1296,7 +1290,7 @@ export class PM_Main extends PM_WithEslintAndTsc {
|
|
|
1296
1290
|
page.close();
|
|
1297
1291
|
oStream.close();
|
|
1298
1292
|
});
|
|
1299
|
-
|
|
1293
|
+
|
|
1300
1294
|
return;
|
|
1301
1295
|
};
|
|
1302
1296
|
|
|
@@ -1330,7 +1324,7 @@ export class PM_Main extends PM_WithEslintAndTsc {
|
|
|
1330
1324
|
});
|
|
1331
1325
|
|
|
1332
1326
|
page.on("console", (log: ConsoleMessage) => {
|
|
1333
|
-
console.log("console message: ", log.text());
|
|
1327
|
+
// console.log("console message: ", log.text());
|
|
1334
1328
|
if (oStream.closed) {
|
|
1335
1329
|
console.log("missed console message: ", log.text());
|
|
1336
1330
|
return;
|
|
@@ -1347,14 +1341,24 @@ export class PM_Main extends PM_WithEslintAndTsc {
|
|
|
1347
1341
|
await page.goto(`file://${`${destFolder}.html`}`, {});
|
|
1348
1342
|
|
|
1349
1343
|
await page
|
|
1350
|
-
.evaluate(
|
|
1344
|
+
.evaluate(
|
|
1345
|
+
`
|
|
1346
|
+
import('${d}').then(async (x) => {
|
|
1347
|
+
try {
|
|
1348
|
+
return await (await x.default).receiveTestResourceConfig(${webArgz})
|
|
1349
|
+
} catch (e) {
|
|
1350
|
+
console.log("web run failure", e.toString())
|
|
1351
|
+
}
|
|
1352
|
+
})
|
|
1353
|
+
`
|
|
1354
|
+
)
|
|
1351
1355
|
.then(async ({ fails, failed, features }: IFinalResults) => {
|
|
1352
1356
|
statusMessagePretty(fails, src, "web");
|
|
1353
1357
|
this.bddTestIsNowDone(src, fails);
|
|
1354
|
-
close();
|
|
1358
|
+
// close();
|
|
1355
1359
|
})
|
|
1356
1360
|
.catch((e) => {
|
|
1357
|
-
console.log(ansiC.red(ansiC.inverse(e)));
|
|
1361
|
+
console.log(ansiC.red(ansiC.inverse(e.stack)));
|
|
1358
1362
|
|
|
1359
1363
|
console.log(
|
|
1360
1364
|
ansiC.red(
|
|
@@ -1367,6 +1371,7 @@ export class PM_Main extends PM_WithEslintAndTsc {
|
|
|
1367
1371
|
})
|
|
1368
1372
|
.finally(() => {
|
|
1369
1373
|
// process.exit(-1);
|
|
1374
|
+
close();
|
|
1370
1375
|
});
|
|
1371
1376
|
|
|
1372
1377
|
return page;
|
package/src/PM/node.ts
CHANGED
|
@@ -182,7 +182,12 @@ export class PM_Node extends PM {
|
|
|
182
182
|
return await this.send("write", ...arguments);
|
|
183
183
|
}
|
|
184
184
|
|
|
185
|
-
async writeFileSync(
|
|
185
|
+
async writeFileSync(x) {
|
|
186
|
+
const z = arguments["0"];
|
|
187
|
+
|
|
188
|
+
const filepath = z[0];
|
|
189
|
+
const contents = z[1];
|
|
190
|
+
|
|
186
191
|
return await this.send<boolean>(
|
|
187
192
|
"writeFileSync",
|
|
188
193
|
this.testResourceConfiguration.fs + "/" + filepath,
|
package/src/PM/pure.ts
CHANGED
|
@@ -136,7 +136,12 @@ export class PM_Pure extends PM {
|
|
|
136
136
|
return globalThis["write"](uid, contents);
|
|
137
137
|
}
|
|
138
138
|
|
|
139
|
-
writeFileSync(
|
|
139
|
+
writeFileSync(x) {
|
|
140
|
+
const z = arguments["0"];
|
|
141
|
+
|
|
142
|
+
const filepath = z[0];
|
|
143
|
+
const contents = z[1];
|
|
144
|
+
|
|
140
145
|
return globalThis["writeFileSync"](
|
|
141
146
|
this.testResourceConfiguration.fs + "/" + filepath,
|
|
142
147
|
contents,
|
package/src/PM/web.ts
CHANGED
|
@@ -111,8 +111,8 @@ export class PM_Web extends PM {
|
|
|
111
111
|
customScreenShot(x: ScreenshotOptions, y: any) {
|
|
112
112
|
const opts = x[0];
|
|
113
113
|
const page = x[1];
|
|
114
|
-
console.log("customScreenShot 2 opts", opts);
|
|
115
|
-
console.log("customScreenShot 2 page", page);
|
|
114
|
+
// console.log("customScreenShot 2 opts", opts);
|
|
115
|
+
// console.log("customScreenShot 2 page", page);
|
|
116
116
|
return window["customScreenShot"](
|
|
117
117
|
{
|
|
118
118
|
...opts,
|
|
@@ -135,7 +135,11 @@ export class PM_Web extends PM {
|
|
|
135
135
|
return window["write"](uid, contents);
|
|
136
136
|
}
|
|
137
137
|
|
|
138
|
-
writeFileSync(
|
|
138
|
+
writeFileSync(x) {
|
|
139
|
+
const z = arguments["0"];
|
|
140
|
+
|
|
141
|
+
const filepath = z[0];
|
|
142
|
+
const contents = z[1];
|
|
139
143
|
return window["writeFileSync"](
|
|
140
144
|
this.testResourceConfiguration.fs + "/" + filepath,
|
|
141
145
|
contents,
|
package/src/Pure.test.ts
CHANGED
|
@@ -105,8 +105,8 @@ const implementation: ITestImplementation<I, O> = {
|
|
|
105
105
|
...store,
|
|
106
106
|
pm: {
|
|
107
107
|
...store.pm,
|
|
108
|
-
testResourceConfiguration: { name: "test-resource" }
|
|
109
|
-
}
|
|
108
|
+
testResourceConfiguration: { name: "test-resource" },
|
|
109
|
+
},
|
|
110
110
|
};
|
|
111
111
|
default:
|
|
112
112
|
return store;
|
|
@@ -116,23 +116,23 @@ const implementation: ITestImplementation<I, O> = {
|
|
|
116
116
|
console.debug("[DEBUG] Adding artifact");
|
|
117
117
|
return {
|
|
118
118
|
...store,
|
|
119
|
-
artifacts: [...(store.artifacts || []), artifact]
|
|
119
|
+
artifacts: [...(store.artifacts || []), artifact],
|
|
120
120
|
};
|
|
121
121
|
},
|
|
122
122
|
setTestJobs: (jobs: any[]) => (store) => {
|
|
123
123
|
console.debug("[DEBUG] Setting test jobs");
|
|
124
124
|
return {
|
|
125
125
|
...store,
|
|
126
|
-
testJobs: jobs
|
|
126
|
+
testJobs: jobs,
|
|
127
127
|
};
|
|
128
128
|
},
|
|
129
129
|
modifySpecs: (modifier: (specs: any) => any[]) => (store) => {
|
|
130
130
|
console.debug("[DEBUG] Modifying specs");
|
|
131
131
|
return {
|
|
132
132
|
...store,
|
|
133
|
-
specs: modifier(store.specs || [])
|
|
133
|
+
specs: modifier(store.specs || []),
|
|
134
134
|
};
|
|
135
|
-
}
|
|
135
|
+
},
|
|
136
136
|
},
|
|
137
137
|
|
|
138
138
|
thens: {
|
package/src/Pure.ts
CHANGED
|
@@ -39,15 +39,9 @@ export class PureTesteranto<
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
async receiveTestResourceConfig(partialTestResource: string) {
|
|
42
|
-
console.log(
|
|
43
|
-
"[DEBUG] receiveTestResourceConfig called with:",
|
|
44
|
-
partialTestResource
|
|
45
|
-
);
|
|
46
42
|
const t: ITTestResourceConfiguration = JSON.parse(partialTestResource);
|
|
47
43
|
const pm = new PM_Pure(t);
|
|
48
44
|
|
|
49
|
-
// console.log("[DEBUG] Current test jobs:", this.testJobs?.length);
|
|
50
|
-
|
|
51
45
|
// if (!this.testJobs || this.testJobs.length === 0) {
|
|
52
46
|
// console.error(
|
|
53
47
|
// "[ERROR] No test jobs available - checking specs:",
|
|
@@ -64,9 +58,7 @@ export class PureTesteranto<
|
|
|
64
58
|
// }
|
|
65
59
|
|
|
66
60
|
try {
|
|
67
|
-
console.log("[DEBUG] Executing test job with PM:", pm);
|
|
68
61
|
const result = await this.testJobs[0].receiveTestResourceConfig(pm);
|
|
69
|
-
console.log("[DEBUG] Test job completed with result:", result);
|
|
70
62
|
return result;
|
|
71
63
|
} catch (e) {
|
|
72
64
|
console.error("[ERROR] Test job failed:", e);
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
3
|
+
/* eslint-disable @typescript-eslint/no-empty-object-type */
|
|
4
|
+
|
|
5
|
+
import { IncomingMessage, Server, ServerResponse } from "http";
|
|
6
|
+
|
|
7
|
+
import {
|
|
8
|
+
Ibdd_in,
|
|
9
|
+
Ibdd_out,
|
|
10
|
+
ITestAdapter,
|
|
11
|
+
ITestImplementation,
|
|
12
|
+
ITestSpecification,
|
|
13
|
+
} from "../CoreTypes";
|
|
14
|
+
import testeranto from "../Node";
|
|
15
|
+
import { ReportServerOfPort } from "../ReportServerLib";
|
|
16
|
+
import { PM } from "../PM";
|
|
17
|
+
import { ITTestResourceConfiguration } from "../lib";
|
|
18
|
+
import { IPM } from "../lib/types";
|
|
19
|
+
import { PM_Node } from "../PM/node";
|
|
20
|
+
import { util } from "chai";
|
|
21
|
+
|
|
22
|
+
type O = Ibdd_out<
|
|
23
|
+
{ Default: [] },
|
|
24
|
+
{
|
|
25
|
+
"the http server which is used in development": [];
|
|
26
|
+
},
|
|
27
|
+
// There are no "whens", it is a stateless server.
|
|
28
|
+
{},
|
|
29
|
+
{
|
|
30
|
+
"the frontpage looks good": [];
|
|
31
|
+
"the projects page looks good": [];
|
|
32
|
+
"a project page looks good": [];
|
|
33
|
+
"a test page looks good": [];
|
|
34
|
+
}
|
|
35
|
+
>;
|
|
36
|
+
|
|
37
|
+
const specification: ITestSpecification<I, O> = (Suite, Given, When, Then) => [
|
|
38
|
+
Suite.Default("the http server which is used in development", {
|
|
39
|
+
initialization: Given["the http server which is used in development"](
|
|
40
|
+
["It should serve the front page", "It should serve the ReportApp"],
|
|
41
|
+
[],
|
|
42
|
+
[
|
|
43
|
+
Then["the frontpage looks good"](),
|
|
44
|
+
// Then["the projects page looks good"](),
|
|
45
|
+
// Then["a project page looks good"](),
|
|
46
|
+
// Then["a test page looks good"](),
|
|
47
|
+
]
|
|
48
|
+
),
|
|
49
|
+
}),
|
|
50
|
+
];
|
|
51
|
+
|
|
52
|
+
const implementation: ITestImplementation<I, O, M> = {
|
|
53
|
+
suites: {
|
|
54
|
+
Default: "the http server which is used in development",
|
|
55
|
+
},
|
|
56
|
+
|
|
57
|
+
givens: {
|
|
58
|
+
"the http server which is used in development": function (
|
|
59
|
+
subject
|
|
60
|
+
): Server<typeof IncomingMessage, typeof ServerResponse> {
|
|
61
|
+
// throw new Error("Function not implemented.");
|
|
62
|
+
return subject;
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
|
|
66
|
+
// There are no "whens", it is a stateless server.
|
|
67
|
+
whens: {},
|
|
68
|
+
|
|
69
|
+
thens: {
|
|
70
|
+
"the frontpage looks good": async (port, utils) => {
|
|
71
|
+
// throw new Error("Function not implemented.");
|
|
72
|
+
|
|
73
|
+
// utils.newPage(`localhost:${port}`);
|
|
74
|
+
debugger;
|
|
75
|
+
const page = await utils.newPage();
|
|
76
|
+
utils.goto(page, `localhost:${port}`);
|
|
77
|
+
utils.customScreenShot({ path: `frontpage.png` }, page);
|
|
78
|
+
|
|
79
|
+
return;
|
|
80
|
+
},
|
|
81
|
+
|
|
82
|
+
"the projects page looks good": function (): (
|
|
83
|
+
port,
|
|
84
|
+
utils: PM
|
|
85
|
+
) => Server<typeof IncomingMessage, typeof ServerResponse> {
|
|
86
|
+
throw new Error("Function not implemented.");
|
|
87
|
+
},
|
|
88
|
+
"a project page looks good": function (): (
|
|
89
|
+
port,
|
|
90
|
+
utils: PM
|
|
91
|
+
) => Server<typeof IncomingMessage, typeof ServerResponse> {
|
|
92
|
+
throw new Error("Function not implemented.");
|
|
93
|
+
},
|
|
94
|
+
"a test page looks good": function (): (
|
|
95
|
+
port,
|
|
96
|
+
utils: PM
|
|
97
|
+
) => Server<typeof IncomingMessage, typeof ServerResponse> {
|
|
98
|
+
throw new Error("Function not implemented.");
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
const adapter: ITestAdapter<I> = {
|
|
104
|
+
assertThis: function (
|
|
105
|
+
x: Server<typeof IncomingMessage, typeof ServerResponse>
|
|
106
|
+
) {
|
|
107
|
+
throw new Error("Function not implemented.");
|
|
108
|
+
},
|
|
109
|
+
andWhen: function (
|
|
110
|
+
store: Server<typeof IncomingMessage, typeof ServerResponse>,
|
|
111
|
+
whenCB: Server<typeof IncomingMessage, typeof ServerResponse>,
|
|
112
|
+
testResource: ITTestResourceConfiguration,
|
|
113
|
+
pm: IPM
|
|
114
|
+
): Promise<Server<typeof IncomingMessage, typeof ServerResponse>> {
|
|
115
|
+
throw new Error("Function not implemented.");
|
|
116
|
+
},
|
|
117
|
+
butThen: function (
|
|
118
|
+
store: Server<typeof IncomingMessage, typeof ServerResponse>,
|
|
119
|
+
thenCB: Server<typeof IncomingMessage, typeof ServerResponse>,
|
|
120
|
+
testResource: ITTestResourceConfiguration,
|
|
121
|
+
pm: IPM
|
|
122
|
+
): Promise<Server<typeof IncomingMessage, typeof ServerResponse>> {
|
|
123
|
+
throw new Error("Function not implemented.");
|
|
124
|
+
},
|
|
125
|
+
afterAll: function (
|
|
126
|
+
store: Server<typeof IncomingMessage, typeof ServerResponse>,
|
|
127
|
+
pm: IPM
|
|
128
|
+
) {
|
|
129
|
+
throw new Error("Function not implemented.");
|
|
130
|
+
},
|
|
131
|
+
afterEach: function (
|
|
132
|
+
store: Server<typeof IncomingMessage, typeof ServerResponse>,
|
|
133
|
+
key: string,
|
|
134
|
+
pm: IPM
|
|
135
|
+
): Promise<unknown> {
|
|
136
|
+
throw new Error("Function not implemented.");
|
|
137
|
+
},
|
|
138
|
+
beforeAll: async function (
|
|
139
|
+
input: (
|
|
140
|
+
port: number
|
|
141
|
+
) => Server<typeof IncomingMessage, typeof ServerResponse>,
|
|
142
|
+
testResource: ITTestResourceConfiguration,
|
|
143
|
+
pm: IPM
|
|
144
|
+
): Promise<number> {
|
|
145
|
+
await new Promise((res, rej) => input(testResource.ports[0]));
|
|
146
|
+
return testResource.ports[0];
|
|
147
|
+
},
|
|
148
|
+
beforeEach: function (
|
|
149
|
+
subject: number,
|
|
150
|
+
initializer: (
|
|
151
|
+
c?: any
|
|
152
|
+
) => Server<typeof IncomingMessage, typeof ServerResponse>,
|
|
153
|
+
testResource: ITTestResourceConfiguration,
|
|
154
|
+
initialValues: any,
|
|
155
|
+
pm: IPM
|
|
156
|
+
): Promise<Server<typeof IncomingMessage, typeof ServerResponse>> {
|
|
157
|
+
throw new Error("Function not implemented.");
|
|
158
|
+
},
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
type I = Ibdd_in<
|
|
162
|
+
(port: number) => Server<typeof IncomingMessage, typeof ServerResponse>,
|
|
163
|
+
number,
|
|
164
|
+
Server<typeof IncomingMessage, typeof ServerResponse>,
|
|
165
|
+
// Server<typeof IncomingMessage, typeof ServerResponse>,
|
|
166
|
+
number,
|
|
167
|
+
Server<typeof IncomingMessage, typeof ServerResponse>,
|
|
168
|
+
Server<typeof IncomingMessage, typeof ServerResponse>,
|
|
169
|
+
Server<typeof IncomingMessage, typeof ServerResponse>
|
|
170
|
+
>;
|
|
171
|
+
|
|
172
|
+
type M = {
|
|
173
|
+
givens: {
|
|
174
|
+
[K in keyof O["givens"]]: (...args: any[]) => IProjectPageViewProps;
|
|
175
|
+
};
|
|
176
|
+
whens: {
|
|
177
|
+
[K in keyof O["whens"]]: (
|
|
178
|
+
...args: any[]
|
|
179
|
+
) => (
|
|
180
|
+
props: IProjectPageViewProps,
|
|
181
|
+
utils: any
|
|
182
|
+
) => IProjectPageViewProps & { container?: HTMLElement };
|
|
183
|
+
};
|
|
184
|
+
thens: {
|
|
185
|
+
[K in keyof O["thens"]]: (port: number, pm: PM_Node) => void;
|
|
186
|
+
};
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
export default testeranto<I, O, M>(
|
|
190
|
+
ReportServerOfPort,
|
|
191
|
+
specification,
|
|
192
|
+
implementation,
|
|
193
|
+
adapter
|
|
194
|
+
);
|
package/src/ReportServer.ts
CHANGED
|
@@ -1,135 +1,5 @@
|
|
|
1
1
|
// simple http server to preview reports
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
import http from "http";
|
|
5
|
-
import path from "path";
|
|
6
|
-
import fs from "fs";
|
|
3
|
+
import { ReportServerOfPort } from "./ReportServerLib";
|
|
7
4
|
|
|
8
|
-
|
|
9
|
-
cache: false,
|
|
10
|
-
headers: {
|
|
11
|
-
"Cache-Control": "no-cache, no-store, must-revalidate",
|
|
12
|
-
"Pragma": "no-cache",
|
|
13
|
-
"Expires": "0"
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
const server = http.createServer((req, res) => {
|
|
18
|
-
// Handle potential double responses
|
|
19
|
-
let responded = false;
|
|
20
|
-
|
|
21
|
-
const safeResponse = (handler: () => void) => {
|
|
22
|
-
if (responded) return;
|
|
23
|
-
responded = true;
|
|
24
|
-
try {
|
|
25
|
-
handler();
|
|
26
|
-
} catch (err) {
|
|
27
|
-
console.error('Error handling request:', err);
|
|
28
|
-
if (!res.headersSent) {
|
|
29
|
-
res.writeHead(500);
|
|
30
|
-
}
|
|
31
|
-
res.end('Internal Server Error');
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
req.on('error', (err) => {
|
|
36
|
-
console.error('Request error:', err);
|
|
37
|
-
safeResponse(() => {
|
|
38
|
-
if (!res.headersSent) {
|
|
39
|
-
res.writeHead(400);
|
|
40
|
-
}
|
|
41
|
-
res.end('Bad Request');
|
|
42
|
-
});
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
req.on('end', () => {
|
|
46
|
-
safeResponse(() => {
|
|
47
|
-
const filePath = path.join(process.cwd(), req.url || '');
|
|
48
|
-
|
|
49
|
-
// First check if file exists
|
|
50
|
-
fs.stat(filePath, (err, stats) => {
|
|
51
|
-
if (err || !stats.isFile()) {
|
|
52
|
-
// Check if directory exists
|
|
53
|
-
fs.stat(filePath, (dirErr, dirStats) => {
|
|
54
|
-
if (!dirErr && dirStats.isDirectory()) {
|
|
55
|
-
// Serve directory listing
|
|
56
|
-
fs.readdir(filePath, (readErr, files) => {
|
|
57
|
-
if (readErr) {
|
|
58
|
-
res.writeHead(500);
|
|
59
|
-
return res.end('Error reading directory');
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
res.writeHead(200, { 'Content-Type': 'text/html' });
|
|
63
|
-
res.write(`
|
|
64
|
-
<html>
|
|
65
|
-
<head>
|
|
66
|
-
<title>Directory Listing: ${req.url}</title>
|
|
67
|
-
<style>
|
|
68
|
-
body { font-family: sans-serif; margin: 2rem; }
|
|
69
|
-
h1 { color: #333; }
|
|
70
|
-
ul { list-style: none; padding: 0; }
|
|
71
|
-
li { padding: 0.5rem; }
|
|
72
|
-
li a { color: #0366d6; text-decoration: none; }
|
|
73
|
-
li a:hover { text-decoration: underline; }
|
|
74
|
-
</style>
|
|
75
|
-
</head>
|
|
76
|
-
<body>
|
|
77
|
-
<h1>Directory: ${req.url}</h1>
|
|
78
|
-
<ul>
|
|
79
|
-
${files.map(file => `
|
|
80
|
-
<li>
|
|
81
|
-
<a href="${path.join(req.url || '', file)}">
|
|
82
|
-
${file}${file.endsWith('/') ? '/' : ''}
|
|
83
|
-
</a>
|
|
84
|
-
</li>
|
|
85
|
-
`).join('')}
|
|
86
|
-
</ul>
|
|
87
|
-
</body>
|
|
88
|
-
</html>
|
|
89
|
-
`);
|
|
90
|
-
res.end();
|
|
91
|
-
});
|
|
92
|
-
} else {
|
|
93
|
-
// Neither file nor directory exists - send 404
|
|
94
|
-
if (!res.headersSent) {
|
|
95
|
-
res.writeHead(404, { 'Content-Type': 'text/plain' });
|
|
96
|
-
res.end('File not found');
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
});
|
|
100
|
-
return;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
// File exists - serve it through node-static
|
|
104
|
-
const serve = () => {
|
|
105
|
-
fileServer.serve(req, res, (err) => {
|
|
106
|
-
if (err && !res.headersSent) {
|
|
107
|
-
res.writeHead(err.status || 500);
|
|
108
|
-
res.end(err.message);
|
|
109
|
-
}
|
|
110
|
-
});
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
// Ensure we don't double-serve
|
|
114
|
-
if (!res.headersSent) {
|
|
115
|
-
serve();
|
|
116
|
-
}
|
|
117
|
-
});
|
|
118
|
-
});
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
req.resume();
|
|
122
|
-
});
|
|
123
|
-
|
|
124
|
-
server.listen(8080, () => {
|
|
125
|
-
console.log('Server running on http://localhost:8080');
|
|
126
|
-
console.log('Serving files from:', process.cwd());
|
|
127
|
-
});
|
|
128
|
-
|
|
129
|
-
server.on('error', (err) => {
|
|
130
|
-
console.error('Server error:', err);
|
|
131
|
-
});
|
|
132
|
-
|
|
133
|
-
process.on('uncaughtException', (err) => {
|
|
134
|
-
console.error('Uncaught exception:', err);
|
|
135
|
-
});
|
|
5
|
+
ReportServerOfPort(process.argv[2]);
|