testeranto 0.125.2 → 0.128.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/dist/common/src/Node.js +5 -0
- package/dist/common/src/PM/base.js +6 -0
- package/dist/common/src/PM/index.js +0 -1
- package/dist/common/src/PM/main.js +75 -20
- package/dist/common/src/PM/web.js +1 -1
- package/dist/common/src/ReportServer.js +39 -2
- package/dist/common/src/build.js +41 -6
- package/dist/common/src/lib/abstractBase.js +22 -107
- package/dist/common/src/lib/basebuilder.js +20 -21
- package/dist/common/src/lib/classBuilder.js +12 -1
- package/dist/common/src/lib/core.js +1 -8
- package/dist/common/src/lib/index.js +2 -5
- package/dist/common/src/lib/pmProxy.js +294 -0
- package/dist/common/testeranto.config.js +43 -34
- package/dist/common/tsconfig.common.tsbuildinfo +1 -1
- package/dist/module/src/Node.js +5 -0
- package/dist/module/src/PM/base.js +6 -0
- package/dist/module/src/PM/index.js +0 -1
- package/dist/module/src/PM/main.js +75 -20
- package/dist/module/src/PM/web.js +1 -1
- package/dist/module/src/Project.js +6 -6
- package/dist/module/src/ReportClient.js +3 -3
- package/dist/module/src/ReportServer.js +39 -2
- package/dist/module/src/build.js +41 -6
- package/dist/module/src/lib/abstractBase.js +22 -107
- package/dist/module/src/lib/basebuilder.js +20 -21
- package/dist/module/src/lib/classBuilder.js +12 -1
- package/dist/module/src/lib/core.js +1 -8
- package/dist/module/src/lib/index.js +2 -5
- package/dist/module/src/lib/pmProxy.js +285 -0
- package/dist/module/testeranto.config.js +40 -34
- package/dist/module/tsconfig.module.tsbuildinfo +1 -1
- package/dist/prebuild/Project.css +1 -26
- package/dist/prebuild/Project.js +4 -4
- package/dist/prebuild/ReportClient.css +1 -26
- package/dist/prebuild/ReportClient.js +3 -3
- package/dist/prebuild/ReportServer.mjs +1 -2
- package/dist/prebuild/TestReport.css +1 -26
- package/dist/prebuild/build.mjs +42 -7
- package/dist/prebuild/run.mjs +82 -18
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/src/PM/web.d.ts +1 -1
- package/dist/types/src/Types.d.ts +2 -1
- package/dist/types/src/lib/abstractBase.d.ts +4 -6
- package/dist/types/src/lib/index.d.ts +1 -1
- package/dist/types/src/lib/pmProxy.d.ts +7 -0
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/package.json +14 -6
- package/src/Init.ts +1 -0
- package/src/Node.ts +6 -0
- package/src/PM/base.ts +8 -0
- package/src/PM/index.ts +2 -7
- package/src/PM/main.ts +112 -23
- package/src/PM/web.ts +3 -3
- package/src/Project.tsx +6 -6
- package/src/ReportClient.tsx +3 -3
- package/src/ReportServer.ts +43 -2
- package/src/Types.ts +3 -2
- package/src/build.ts +47 -6
- package/src/lib/abstractBase.ts +45 -184
- package/src/lib/basebuilder.ts +25 -28
- package/src/lib/classBuilder.ts +13 -2
- package/src/lib/core.ts +10 -14
- package/src/lib/index.ts +6 -29
- package/src/lib/pmProxy.ts +366 -0
- package/testeranto/bundles/node/{react → redux}/metafile.json +186 -254
- package/testeranto/bundles/pure/redux/metafile.json +554 -0
- package/testeranto/bundles/web/redux/metafile.json +504 -0
- package/testeranto/bundles/web/{react/src/SubPackages/react-test-renderer/component → redux}/test/web.html +1 -1
- package/testeranto/index.html +1 -1
- package/testeranto/reports/{react → redux}/config.json +26 -10
- package/testeranto/reports/{react → redux}/index.html +5 -5
- package/testeranto/reports/redux/summary.json +20 -0
- package/testeranto.config.ts +46 -34
- package/tsc.log +3 -1
- package/testeranto/bundles/node/react/src/SubPackages/react-test-renderer/component/test/node.mjs +0 -24687
- package/testeranto/bundles/pure/react/metafile.json +0 -8
- package/testeranto/bundles/pure/react/src/SubPackages/react-test-renderer/component/test/pure.mjs +0 -24625
- package/testeranto/bundles/web/react/metafile.json +0 -8
- package/testeranto/bundles/web/react/src/SubPackages/react-test-renderer/component/test/web.mjs +0 -21290
- package/testeranto/reports/react/src/SubPackages/react-test-renderer/component/test/node/node/console_log.txt +0 -0
- package/testeranto/reports/react/src/SubPackages/react-test-renderer/component/test/pure/pure/bdd_errors.txt +0 -1
- package/testeranto/reports/react/src/SubPackages/react-test-renderer/component/test/pure/pure/featurePrompt.txt +0 -0
- package/testeranto/reports/react/src/SubPackages/react-test-renderer/component/test/pure/pure/lint_errors.json +0 -3381
- package/testeranto/reports/react/src/SubPackages/react-test-renderer/component/test/pure/pure/littleBoard.html +0 -20
- package/testeranto/reports/react/src/SubPackages/react-test-renderer/component/test/pure/pure/log.txt +0 -40
- package/testeranto/reports/react/src/SubPackages/react-test-renderer/component/test/pure/pure/prompt.txt +0 -24
- package/testeranto/reports/react/src/SubPackages/react-test-renderer/component/test/pure/pure/tests.json +0 -132
- package/testeranto/reports/react/src/SubPackages/react-test-renderer/component/test/pure/pure/type_errors.txt +0 -17
- package/testeranto/reports/react/src/SubPackages/react-test-renderer/component/test/web/web/bdd_errors.txt +0 -1
- package/testeranto/reports/react/src/SubPackages/react-test-renderer/component/test/web/web/console_log.txt +0 -1
- package/testeranto/reports/react/src/SubPackages/react-test-renderer/component/test/web/web/lint_errors.json +0 -2947
- package/testeranto/reports/react/src/SubPackages/react-test-renderer/component/test/web/web/littleBoard.html +0 -20
- package/testeranto/reports/react/src/SubPackages/react-test-renderer/component/test/web/web/log.txt +0 -40
- package/testeranto/reports/react/src/SubPackages/react-test-renderer/component/test/web/web/prompt.txt +0 -23
- package/testeranto/reports/react/src/SubPackages/react-test-renderer/component/test/web/web/tests.json +0 -132
- package/testeranto/reports/react/src/SubPackages/react-test-renderer/component/test/web/web/type_errors.txt +0 -18
- package/testeranto/reports/react/summary.json +0 -8
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.128.0",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": "18.18.0"
|
|
7
7
|
},
|
|
@@ -121,6 +121,10 @@
|
|
|
121
121
|
"import": "./dist/module/SubPackages/react-dom/component/node.js",
|
|
122
122
|
"require": "./dist/common/SubPackages/react-dom/component/node.js"
|
|
123
123
|
},
|
|
124
|
+
"./src/lib/abstractBase": {
|
|
125
|
+
"import": "./src/lib/abstractBase.ts",
|
|
126
|
+
"require": "./src/lib/abstractBase.ts"
|
|
127
|
+
},
|
|
124
128
|
"./src/Types": {
|
|
125
129
|
"import": "./src/Types.ts",
|
|
126
130
|
"require": "./src/Types.ts"
|
|
@@ -184,7 +188,8 @@
|
|
|
184
188
|
"./dist/module/NodeWriter": {
|
|
185
189
|
"import": "./dist/module/NodeWriter.js",
|
|
186
190
|
"require": "./dist/common/NodeWriter.js"
|
|
187
|
-
}
|
|
191
|
+
},
|
|
192
|
+
"./src/**/*": "./src/**/*.ts"
|
|
188
193
|
},
|
|
189
194
|
"repository": "git@github.com:adamwong246/testeranto.git",
|
|
190
195
|
"homepage": "https://github.com/adamwong246/testeranto",
|
|
@@ -207,9 +212,10 @@
|
|
|
207
212
|
"build-types": "tsc -p tsconfig.types.json",
|
|
208
213
|
"type-check": "yarn tsc --noEmit > tsc.log",
|
|
209
214
|
"type-fix": "aider --model deepseek/deepseek-chat --load type-fix.txt",
|
|
210
|
-
"t-build": "tsx
|
|
211
|
-
"t-run": "tsx
|
|
212
|
-
"t-init": "tsx
|
|
215
|
+
"t-build": "tsx dist/prebuild/build.mjs",
|
|
216
|
+
"t-run": "tsx dist/prebuild/run.mjs",
|
|
217
|
+
"t-init": "tsx dist/prebuild/init-docs.mjs",
|
|
218
|
+
"t-report": "tsx dist/prebuild/ReportServer.mjs"
|
|
213
219
|
},
|
|
214
220
|
"peerDependencies": {
|
|
215
221
|
"@types/react": "18.2.0",
|
|
@@ -235,6 +241,8 @@
|
|
|
235
241
|
"@types/ws": "^8.5.10",
|
|
236
242
|
"@typescript-eslint/eslint-plugin": "^5.46.0",
|
|
237
243
|
"@typescript-eslint/parser": "^5.46.0",
|
|
244
|
+
"testeranto-solidity": "latest",
|
|
245
|
+
"testeranto_with_reduxjs_toolkit": "latest",
|
|
238
246
|
"ts-node": "^10.9.1",
|
|
239
247
|
"typescript": "^5.8.2"
|
|
240
248
|
},
|
|
@@ -276,7 +284,7 @@
|
|
|
276
284
|
"react-test-renderer": "18.2.0",
|
|
277
285
|
"recursive-watch": "^1.1.4",
|
|
278
286
|
"rpc-over-ipc": "^1.0.0",
|
|
279
|
-
"testeranto": "^0.
|
|
287
|
+
"testeranto": "^0.125.3",
|
|
280
288
|
"tsc-prog": "^2.3.0",
|
|
281
289
|
"tsx": "^4.19.3",
|
|
282
290
|
"typescript-eslint": "^8.29.1",
|
package/src/Init.ts
CHANGED
package/src/Node.ts
CHANGED
|
@@ -64,7 +64,13 @@ const testeranto = async <I extends IT, O extends OT, M>(
|
|
|
64
64
|
testInterface
|
|
65
65
|
);
|
|
66
66
|
|
|
67
|
+
process.on("unhandledRejection", (reason, promise) => {
|
|
68
|
+
console.error("Unhandled Rejection at:", promise, "reason:", reason);
|
|
69
|
+
// Optionally, terminate the process or perform cleanup
|
|
70
|
+
});
|
|
71
|
+
|
|
67
72
|
try {
|
|
73
|
+
console.log(process.argv);
|
|
68
74
|
const f = await t.receiveTestResourceConfig(process.argv[2]);
|
|
69
75
|
|
|
70
76
|
console.error("goodbye node error", f.fails);
|
package/src/PM/base.ts
CHANGED
|
@@ -175,7 +175,15 @@ export abstract class PM_Base {
|
|
|
175
175
|
}
|
|
176
176
|
|
|
177
177
|
async createWriteStream(filepath: string, testName: string): Promise<number> {
|
|
178
|
+
const folder = filepath.split("/").slice(0, -1).join("/");
|
|
179
|
+
|
|
178
180
|
return new Promise<number>((res) => {
|
|
181
|
+
if (!fs.existsSync(folder)) {
|
|
182
|
+
return fs.mkdirSync(folder, {
|
|
183
|
+
recursive: true,
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
|
|
179
187
|
const f = fs.createWriteStream(filepath);
|
|
180
188
|
fileStreams3.push(f);
|
|
181
189
|
if (!files[testName]) {
|
package/src/PM/index.ts
CHANGED
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
import { Page } from "puppeteer-core";
|
|
2
|
-
import {
|
|
3
|
-
CdpPage,
|
|
4
|
-
ScreenRecorderOptions,
|
|
5
|
-
} from "puppeteer-core/lib/esm/puppeteer";
|
|
6
|
-
import { ITLog, ITTestResourceConfiguration } from "../lib";
|
|
2
|
+
import { ScreenRecorderOptions } from "puppeteer-core/lib/esm/puppeteer";
|
|
7
3
|
|
|
8
|
-
|
|
9
|
-
const fPaths: IFPaths = [];
|
|
4
|
+
import { ITLog, ITTestResourceConfiguration } from "../lib";
|
|
10
5
|
|
|
11
6
|
export abstract class PM {
|
|
12
7
|
server: any;
|
package/src/PM/main.ts
CHANGED
|
@@ -275,7 +275,9 @@ export class PM_Main extends PM_Base {
|
|
|
275
275
|
const hash = await fileHash(outputFile);
|
|
276
276
|
if (fileHashes[k] !== hash) {
|
|
277
277
|
fileHashes[k] = hash;
|
|
278
|
-
console.log(
|
|
278
|
+
console.log(
|
|
279
|
+
ansiC.yellow(ansiC.inverse(`< ${e} ${filename}`))
|
|
280
|
+
);
|
|
279
281
|
launcher(k, outputFile);
|
|
280
282
|
}
|
|
281
283
|
});
|
|
@@ -290,7 +292,7 @@ export class PM_Main extends PM_Base {
|
|
|
290
292
|
watcher(
|
|
291
293
|
watch(metafile, async (e, filename) => {
|
|
292
294
|
console.log(
|
|
293
|
-
ansiC.
|
|
295
|
+
ansiC.yellow(ansiC.inverse(`< ${e} ${filename} (${runtime})`))
|
|
294
296
|
);
|
|
295
297
|
this.metafileOutputs(runtime);
|
|
296
298
|
})
|
|
@@ -382,7 +384,6 @@ export class PM_Main extends PM_Base {
|
|
|
382
384
|
basePath: process.cwd(), // always required, used for relative paths
|
|
383
385
|
configFilePath: "tsconfig.json", // config to inherit from (optional)
|
|
384
386
|
compilerOptions: {
|
|
385
|
-
rootDir: "src",
|
|
386
387
|
outDir: tscPather(entrypoint, platform, this.name),
|
|
387
388
|
// declaration: true,
|
|
388
389
|
// skipLibCheck: true,
|
|
@@ -683,24 +684,53 @@ ${addableFiles
|
|
|
683
684
|
// })
|
|
684
685
|
// );
|
|
685
686
|
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
.
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
687
|
+
try {
|
|
688
|
+
await import(`${builtfile}?cacheBust=${Date.now()}`).then((module) => {
|
|
689
|
+
return module.default
|
|
690
|
+
.then((defaultModule) => {
|
|
691
|
+
defaultModule
|
|
692
|
+
.receiveTestResourceConfig(argz)
|
|
693
|
+
.then(async (results: IFinalResults) => {
|
|
694
|
+
this.receiveFeatures(results.features, destFolder, src, "pure");
|
|
695
|
+
statusMessagePretty(results.fails, src);
|
|
696
|
+
this.bddTestIsNowDone(src, results.fails);
|
|
697
|
+
})
|
|
698
|
+
.catch((e) => {
|
|
699
|
+
console.log(
|
|
700
|
+
ansiC.red(ansiC.inverse(`${src} errored with: ${e}`))
|
|
701
|
+
);
|
|
702
|
+
this.bddTestIsNowDone(src, -1);
|
|
703
|
+
})
|
|
704
|
+
.finally(() => {
|
|
705
|
+
webSideCares.forEach((webSideCar) => webSideCar.close());
|
|
706
|
+
});
|
|
694
707
|
})
|
|
695
708
|
.catch((e) => {
|
|
696
|
-
console.log(
|
|
709
|
+
console.log(
|
|
710
|
+
ansiC.red(
|
|
711
|
+
ansiC.inverse(
|
|
712
|
+
`${src} errored with: ${e}. Check ${reportDest}/error.txt for more info`
|
|
713
|
+
)
|
|
714
|
+
)
|
|
715
|
+
);
|
|
716
|
+
this.writeFileSync(`${reportDest}/error.txt`, e.stack, src);
|
|
697
717
|
this.bddTestIsNowDone(src, -1);
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
webSideCares.forEach((webSideCar) => webSideCar.close());
|
|
718
|
+
statusMessagePretty(-1, src);
|
|
719
|
+
// console.error(e);
|
|
701
720
|
});
|
|
702
721
|
});
|
|
703
|
-
})
|
|
722
|
+
} catch (e) {
|
|
723
|
+
console.log(
|
|
724
|
+
ansiC.red(
|
|
725
|
+
ansiC.inverse(
|
|
726
|
+
`${src} errored with: ${e}. Check ${reportDest}/error.txt for more info`
|
|
727
|
+
)
|
|
728
|
+
)
|
|
729
|
+
);
|
|
730
|
+
this.writeFileSync(`${reportDest}/error.txt`, e.stack, src);
|
|
731
|
+
this.bddTestIsNowDone(src, -1);
|
|
732
|
+
statusMessagePretty(-1, src);
|
|
733
|
+
}
|
|
704
734
|
|
|
705
735
|
// console.log("portsToUse", portsToUse);
|
|
706
736
|
for (let i = 0; i <= portsToUse.length; i++) {
|
|
@@ -731,7 +761,9 @@ ${addableFiles
|
|
|
731
761
|
});
|
|
732
762
|
|
|
733
763
|
if (!testConfig) {
|
|
734
|
-
console.log(
|
|
764
|
+
console.log(
|
|
765
|
+
ansiC.inverse(`missing test config! Exiting ungracefully for '${src}'`)
|
|
766
|
+
);
|
|
735
767
|
process.exit(-1);
|
|
736
768
|
}
|
|
737
769
|
const testConfigResource = testConfig[2];
|
|
@@ -850,12 +882,43 @@ ${addableFiles
|
|
|
850
882
|
|
|
851
883
|
const oStream = fs.createWriteStream(`${reportDest}/console_log.txt`);
|
|
852
884
|
|
|
853
|
-
const child = spawn(
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
885
|
+
const child = spawn(
|
|
886
|
+
"node",
|
|
887
|
+
[builtfile, testResources, "--trace-warnings"],
|
|
888
|
+
{
|
|
889
|
+
stdio: ["pipe", "pipe", "pipe", "ipc"],
|
|
890
|
+
// silent: true
|
|
891
|
+
}
|
|
892
|
+
);
|
|
893
|
+
|
|
894
|
+
// const child = spawn(
|
|
895
|
+
// "node",
|
|
896
|
+
// ["inspect", builtfile, testResources, "--trace-warnings"],
|
|
897
|
+
// {
|
|
898
|
+
// stdio: ["pipe", "pipe", "pipe", "ipc"],
|
|
899
|
+
// env: {
|
|
900
|
+
// // NODE_INSPECT_RESUME_ON_START: "1",
|
|
901
|
+
// },
|
|
902
|
+
// // silent: true
|
|
903
|
+
// }
|
|
904
|
+
// );
|
|
905
|
+
|
|
906
|
+
// console.log(
|
|
907
|
+
// "spawning",
|
|
908
|
+
// "node",
|
|
909
|
+
// ["inspect", builtfile, testResources, "--trace-warnings"],
|
|
910
|
+
// {
|
|
911
|
+
// NODE_INSPECT_RESUME_ON_START: "1",
|
|
912
|
+
// }
|
|
913
|
+
// );
|
|
857
914
|
|
|
858
915
|
const p = destFolder + "/pipe";
|
|
916
|
+
const errFile = `${reportDest}/error.txt`;
|
|
917
|
+
|
|
918
|
+
if (fs.existsSync(errFile)) {
|
|
919
|
+
fs.rmSync(errFile);
|
|
920
|
+
}
|
|
921
|
+
|
|
859
922
|
server.listen(p, () => {
|
|
860
923
|
child.stderr?.on("data", (data) => {
|
|
861
924
|
oStream.write(`stderr data ${data}`);
|
|
@@ -878,9 +941,35 @@ ${addableFiles
|
|
|
878
941
|
statusMessagePretty(code, src);
|
|
879
942
|
}
|
|
880
943
|
|
|
881
|
-
|
|
944
|
+
if (fs.existsSync(p)) {
|
|
945
|
+
fs.rmSync(p);
|
|
946
|
+
}
|
|
947
|
+
|
|
948
|
+
haltReturns = true;
|
|
949
|
+
});
|
|
950
|
+
child.on("exit", (code) => {
|
|
951
|
+
haltReturns = true;
|
|
952
|
+
});
|
|
953
|
+
child.on("error", (e) => {
|
|
954
|
+
haltReturns = true;
|
|
955
|
+
|
|
956
|
+
if (fs.existsSync(p)) {
|
|
957
|
+
fs.rmSync(p);
|
|
958
|
+
}
|
|
959
|
+
console.log(
|
|
960
|
+
ansiC.red(
|
|
961
|
+
ansiC.inverse(
|
|
962
|
+
`${src} errored with: ${e.name}. Check ${errFile}for more info`
|
|
963
|
+
)
|
|
964
|
+
)
|
|
965
|
+
);
|
|
966
|
+
this.writeFileSync(`${reportDest}/error.txt`, e.toString(), src);
|
|
967
|
+
this.bddTestIsNowDone(src, -1);
|
|
968
|
+
statusMessagePretty(-1, src);
|
|
969
|
+
|
|
970
|
+
// this.bddTestIsNowDone(src, -1);
|
|
971
|
+
// statusMessagePretty(-1, src);
|
|
882
972
|
});
|
|
883
|
-
child.on("exit", (code) => {});
|
|
884
973
|
});
|
|
885
974
|
|
|
886
975
|
child.send({ path: p });
|
package/src/PM/web.ts
CHANGED
|
@@ -43,7 +43,7 @@ export class PM_Web {
|
|
|
43
43
|
return window["closePage"](p);
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
goto(p, url: string)
|
|
46
|
+
goto(p, url: string) {
|
|
47
47
|
return window["goto"](p, url);
|
|
48
48
|
}
|
|
49
49
|
|
|
@@ -60,10 +60,10 @@ export class PM_Web {
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
getAttribute(selector: string, attribute: string) {
|
|
63
|
-
return window["
|
|
63
|
+
return window["getAttribute"](selector, attribute);
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
getValue(selector:
|
|
66
|
+
getValue(selector: number) {
|
|
67
67
|
return window["getValue"](selector);
|
|
68
68
|
}
|
|
69
69
|
|
package/src/Project.tsx
CHANGED
|
@@ -78,8 +78,8 @@ const BigBoard = () => {
|
|
|
78
78
|
const x: Promise<[string, IBuiltConfig, ISummary]>[] = projects.map(async (p) => {
|
|
79
79
|
return [
|
|
80
80
|
p,
|
|
81
|
-
(await (await fetch(
|
|
82
|
-
(await (await fetch(
|
|
81
|
+
(await (await fetch(`./reports/${p}/config.json`)).json()) as IBuiltConfig,
|
|
82
|
+
(await (await fetch(`./reports/${p}/summary.json`)).json()) as ISummary
|
|
83
83
|
] as [string, IBuiltConfig, ISummary]
|
|
84
84
|
})
|
|
85
85
|
|
|
@@ -158,9 +158,9 @@ const BigBoard = () => {
|
|
|
158
158
|
return <tr>
|
|
159
159
|
<td>{t[0]}</td>
|
|
160
160
|
<td>{t[1]}</td>
|
|
161
|
-
<td><a href={
|
|
162
|
-
<td><a href={
|
|
163
|
-
<td><a href={
|
|
161
|
+
<td><a href={`./reports/${x}/index.html`}>{y.runTimeError}</a></td>
|
|
162
|
+
<td><a href={`./reports/${x}/lint_errors.json`}>{y.staticErrors}</a></td>
|
|
163
|
+
<td><a href={`./reports/${x}/type_errors.txt`}>{y.typeErrors}</a></td>
|
|
164
164
|
<td>
|
|
165
165
|
<pre>
|
|
166
166
|
|
|
@@ -197,4 +197,4 @@ document.addEventListener("DOMContentLoaded", function () {
|
|
|
197
197
|
}
|
|
198
198
|
});
|
|
199
199
|
|
|
200
|
-
console.log("hello
|
|
200
|
+
console.log("hello Project!")
|
package/src/ReportClient.tsx
CHANGED
|
@@ -35,7 +35,7 @@ const BigBoard = () => {
|
|
|
35
35
|
const [configs, setConfigs] = useState<IBuiltConfig>();
|
|
36
36
|
useEffect(() => {
|
|
37
37
|
(async () => {
|
|
38
|
-
fetch(
|
|
38
|
+
fetch(`./reports/${window.location.pathname.split('/').pop()}/config.json`)
|
|
39
39
|
.then(response => response.json())
|
|
40
40
|
.then(json => {
|
|
41
41
|
setConfigs(json)
|
|
@@ -48,7 +48,7 @@ const BigBoard = () => {
|
|
|
48
48
|
const [bigBoard, setBigBoard] = useState<Record<string, ISummary>>({});
|
|
49
49
|
useEffect(() => {
|
|
50
50
|
(async () => {
|
|
51
|
-
fetch('
|
|
51
|
+
fetch('./docs/summary.json')
|
|
52
52
|
.then(response => response.json())
|
|
53
53
|
.then(json => {
|
|
54
54
|
setBigBoard(json)
|
|
@@ -167,4 +167,4 @@ document.addEventListener("DOMContentLoaded", function () {
|
|
|
167
167
|
}
|
|
168
168
|
});
|
|
169
169
|
|
|
170
|
-
console.log("hello
|
|
170
|
+
console.log("hello ReportClient!")
|
package/src/ReportServer.ts
CHANGED
|
@@ -1,10 +1,51 @@
|
|
|
1
1
|
import staticServer from "node-static";
|
|
2
2
|
import http from "http";
|
|
3
|
+
// import esbuild from "esbuild";
|
|
3
4
|
|
|
4
5
|
const main = async () => {
|
|
5
|
-
|
|
6
|
+
// esbuild
|
|
7
|
+
// .context(configer(config, Object.keys(entryPoints), testName))
|
|
8
|
+
// .then(async (ctx) => {
|
|
9
|
+
// if (mode === "dev") {
|
|
10
|
+
// await ctx.watch().then((v) => {
|
|
11
|
+
// done();
|
|
12
|
+
// });
|
|
13
|
+
// } else {
|
|
14
|
+
// ctx.rebuild().then((v) => {
|
|
15
|
+
// done();
|
|
16
|
+
// });
|
|
17
|
+
// }
|
|
6
18
|
|
|
7
|
-
|
|
19
|
+
// return ctx;
|
|
20
|
+
// });
|
|
21
|
+
// }),
|
|
22
|
+
|
|
23
|
+
// await esbuild
|
|
24
|
+
// .context({
|
|
25
|
+
// entryPoints: [
|
|
26
|
+
// "node_modules/testeranto/src/ReportClient.tsx",
|
|
27
|
+
// "node_modules/testeranto/src/TestReport.tsx",
|
|
28
|
+
// "node_modules/testeranto/src/Project.tsx",
|
|
29
|
+
// ],
|
|
30
|
+
// bundle: true,
|
|
31
|
+
// format: "iife",
|
|
32
|
+
// platform: "browser",
|
|
33
|
+
// outdir: "./testeranto",
|
|
34
|
+
// define: {
|
|
35
|
+
// REPORT_ROOT: "localhost:8765",
|
|
36
|
+
// },
|
|
37
|
+
// })
|
|
38
|
+
// .then(async (ctx) => {
|
|
39
|
+
// await ctx.watch();
|
|
40
|
+
|
|
41
|
+
// let { host, port } = await ctx.serve({
|
|
42
|
+
// servedir: ".",
|
|
43
|
+
// });
|
|
44
|
+
// });
|
|
45
|
+
|
|
46
|
+
// process.chdir("../"); // Navigate one level up
|
|
47
|
+
|
|
48
|
+
const fileServer = new staticServer.Server("./testeranto", {});
|
|
8
49
|
|
|
9
50
|
http
|
|
10
51
|
.createServer(function (request, response) {
|
package/src/Types.ts
CHANGED
|
@@ -176,8 +176,8 @@ export type Ibdd_in<
|
|
|
176
176
|
///////////////////////////////////////////////
|
|
177
177
|
|
|
178
178
|
export type IPluginFactory = (
|
|
179
|
-
register
|
|
180
|
-
entrypoints
|
|
179
|
+
register?: (entrypoint: string, sources: string[]) => any,
|
|
180
|
+
entrypoints?: string[]
|
|
181
181
|
) => Plugin;
|
|
182
182
|
|
|
183
183
|
export type IRunTime = `node` | `web` | "pure";
|
|
@@ -196,6 +196,7 @@ export type ITestconfig = {
|
|
|
196
196
|
src: string;
|
|
197
197
|
tests: ITestTypes[];
|
|
198
198
|
webPlugins: IPluginFactory[];
|
|
199
|
+
reportDomain: string;
|
|
199
200
|
};
|
|
200
201
|
|
|
201
202
|
export type IBuiltConfig = { buildDir: string } & ITestconfig;
|
package/src/build.ts
CHANGED
|
@@ -32,6 +32,7 @@ if (mode !== "once" && mode !== "dev") {
|
|
|
32
32
|
console.log("testeranto is building", testName, mode);
|
|
33
33
|
|
|
34
34
|
import(process.cwd() + "/" + "testeranto.config.ts").then(async (module) => {
|
|
35
|
+
const pckge = (await import(`${process.cwd()}/package.json`)).default;
|
|
35
36
|
const bigConfig: IProject = module.default;
|
|
36
37
|
|
|
37
38
|
const project = bigConfig.projects[testName];
|
|
@@ -128,12 +129,12 @@ import(process.cwd() + "/" + "testeranto.config.ts").then(async (module) => {
|
|
|
128
129
|
<head>
|
|
129
130
|
<meta name="description" content="Webpage description goes here" />
|
|
130
131
|
<meta charset="utf-8" />
|
|
131
|
-
<title
|
|
132
|
+
<title>${pckge.name} - testeranto</title>
|
|
132
133
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
133
134
|
<meta name="author" content="" />
|
|
134
135
|
|
|
135
|
-
<link rel="stylesheet" href="
|
|
136
|
-
<script type="module" src="
|
|
136
|
+
<link rel="stylesheet" href="../ReportClient.css" />
|
|
137
|
+
<script type="module" src="../ReportClient.js"></script>
|
|
137
138
|
|
|
138
139
|
</head>
|
|
139
140
|
|
|
@@ -161,7 +162,7 @@ import(process.cwd() + "/" + "testeranto.config.ts").then(async (module) => {
|
|
|
161
162
|
<head>
|
|
162
163
|
<meta name="description" content="Webpage description goes here" />
|
|
163
164
|
<meta charset="utf-8" />
|
|
164
|
-
<title
|
|
165
|
+
<title>${pckge.name} - testeranto</title>
|
|
165
166
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
166
167
|
<meta name="author" content="" />
|
|
167
168
|
|
|
@@ -169,8 +170,8 @@ import(process.cwd() + "/" + "testeranto.config.ts").then(async (module) => {
|
|
|
169
170
|
${JSON.stringify(Object.keys(bigConfig.projects))}
|
|
170
171
|
</script>
|
|
171
172
|
|
|
172
|
-
<link rel="stylesheet" href="
|
|
173
|
-
<script type="module" src="
|
|
173
|
+
<link rel="stylesheet" href="Project.css" />
|
|
174
|
+
<script type="module" src="Project.js"></script>
|
|
174
175
|
|
|
175
176
|
</head>
|
|
176
177
|
|
|
@@ -222,6 +223,46 @@ import(process.cwd() + "/" + "testeranto.config.ts").then(async (module) => {
|
|
|
222
223
|
// });
|
|
223
224
|
// });
|
|
224
225
|
|
|
226
|
+
const x: [IRunTime, string[]][] = [
|
|
227
|
+
["pure", Object.keys(importEntryPoints)],
|
|
228
|
+
["node", Object.keys(nodeEntryPoints)],
|
|
229
|
+
["web", Object.keys(webEntryPoints)],
|
|
230
|
+
];
|
|
231
|
+
|
|
232
|
+
x.forEach(async ([runtime, keys]) => {
|
|
233
|
+
keys.forEach(async (k) => {
|
|
234
|
+
const folder = `testeranto/reports/${testName}/${k
|
|
235
|
+
.split(".")
|
|
236
|
+
.slice(0, -1)
|
|
237
|
+
.join(".")}/${runtime}`;
|
|
238
|
+
|
|
239
|
+
await fs.mkdirSync(folder, { recursive: true });
|
|
240
|
+
fs.writeFileSync(
|
|
241
|
+
`${folder}/index.html`,
|
|
242
|
+
`
|
|
243
|
+
<!DOCTYPE html>
|
|
244
|
+
<html lang="en">
|
|
245
|
+
|
|
246
|
+
<head>
|
|
247
|
+
<meta name="description" content="Webpage description goes here" />
|
|
248
|
+
<meta charset="utf-8" />
|
|
249
|
+
<title>${testName} - testeranto</title>
|
|
250
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
251
|
+
<meta name="author" content="" />
|
|
252
|
+
|
|
253
|
+
<link rel="stylesheet" href="../../../../../TestReport.css" />
|
|
254
|
+
<script src="../../../../../TestReport.js"></script>
|
|
255
|
+
|
|
256
|
+
</head>
|
|
257
|
+
|
|
258
|
+
<body>
|
|
259
|
+
<div id="root"/>
|
|
260
|
+
</body>
|
|
261
|
+
`
|
|
262
|
+
);
|
|
263
|
+
});
|
|
264
|
+
});
|
|
265
|
+
|
|
225
266
|
await Promise.all([
|
|
226
267
|
...(
|
|
227
268
|
[
|