testeranto 0.134.0 → 0.140.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/.aider.chat.history.md +14577 -0
- package/.aider.input.history +566 -0
- package/.aider.tags.cache.v3/{8d/fa/12860238755bcfab9af8a93c52ab.val → bd/91/b71f967fd074cf4b757081b429b7.val} +0 -0
- package/.aider.tags.cache.v3/cache.db +0 -0
- package/.aider.tags.cache.v3/{18/8b/7dfca822129dad10b5cacadf7728.val → fb/96/b0f91c7e75e08fc5a6907633cf99.val} +0 -0
- package/README.md +29 -423
- package/bundle.js +1 -1
- package/dist/common/src/CoreTypes.js +2 -0
- package/dist/common/src/Init.js +4 -1
- package/dist/common/src/Node.js +1 -1
- package/dist/common/src/PM/PM_WithEslintAndTsc.js +10 -8
- package/dist/common/src/PM/__tests__/nodeSidecar.testeranto.js +2 -2
- package/dist/common/src/PM/main.js +12 -7
- package/dist/common/src/PM/node.js +10 -3
- package/dist/common/src/Web.js +2 -2
- package/dist/common/src/build.js +7 -72
- package/dist/common/src/defaultConfig.js +0 -1
- package/dist/common/src/esbuildConfigs/eslint-formatter-testeranto.js +16 -1
- package/dist/common/src/esbuildConfigs/node.js +2 -16
- package/dist/common/src/esbuildConfigs/pure.js +2 -16
- package/dist/common/src/esbuildConfigs/rebuildPlugin.js +22 -0
- package/dist/common/src/esbuildConfigs/web.js +2 -16
- package/dist/common/src/lib/abstractBase.js +8 -1
- package/dist/common/src/lib/basebuilder.js +4 -0
- package/dist/common/src/lib/classBuilder.js +2 -3
- package/dist/common/src/lib/core.js +2 -0
- package/dist/common/src/run.js +1 -1
- package/dist/common/src/utils/buildTemplates.js +88 -0
- package/dist/common/tsconfig.common.tsbuildinfo +1 -1
- package/dist/module/src/Init.js +4 -1
- package/dist/module/src/Node.js +1 -1
- package/dist/module/src/PM/PM_WithEslintAndTsc.js +10 -8
- package/dist/module/src/PM/__tests__/nodeSidecar.testeranto.js +2 -2
- package/dist/module/src/PM/main.js +12 -7
- package/dist/module/src/PM/node.js +10 -3
- package/dist/module/src/Project.js +41 -47
- package/dist/module/src/TestReport.js +34 -31
- package/dist/module/src/Web.js +2 -2
- package/dist/module/src/build.js +7 -72
- package/dist/module/src/defaultConfig.js +0 -1
- package/dist/module/src/esbuildConfigs/eslint-formatter-testeranto.js +16 -1
- package/dist/module/src/esbuildConfigs/node.js +2 -16
- package/dist/module/src/esbuildConfigs/pure.js +2 -16
- package/dist/module/src/esbuildConfigs/rebuildPlugin.js +17 -0
- package/dist/module/src/esbuildConfigs/web.js +2 -16
- package/dist/module/src/lib/abstractBase.js +8 -1
- package/dist/module/src/lib/basebuilder.js +4 -0
- package/dist/module/src/lib/classBuilder.js +2 -3
- package/dist/module/src/lib/core.js +2 -0
- package/dist/module/src/run.js +1 -1
- package/dist/module/src/utils/buildTemplates.js +82 -0
- package/dist/module/tsconfig.module.tsbuildinfo +1 -1
- package/dist/prebuild/Project.js +77 -29
- package/dist/prebuild/TestReport.js +51 -32
- package/dist/prebuild/build.mjs +132 -131
- package/dist/prebuild/esbuildConfigs/eslint-formatter-testeranto.mjs +14 -1
- package/dist/prebuild/init-docs.mjs +0 -4
- package/dist/prebuild/run.mjs +50 -31
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/types/src/CoreTypes.d.ts +53 -0
- package/dist/types/src/Node.d.ts +3 -3
- package/dist/types/src/PM/__tests__/nodeSidecar.testeranto.d.ts +2 -4
- package/dist/types/src/PM/__tests__/pureSidecar.testeranto.d.ts +2 -4
- package/dist/types/src/PM/__tests__/webSidecar.testeranto.d.ts +2 -4
- package/dist/types/src/PM/index.d.ts +1 -1
- package/dist/types/src/PM/nodeSidecar.d.ts +2 -2
- package/dist/types/src/Pure.d.ts +3 -3
- package/dist/types/src/Types.d.ts +21 -61
- package/dist/types/src/Web.d.ts +3 -3
- package/dist/types/src/esbuildConfigs/rebuildPlugin.d.ts +6 -0
- package/dist/types/src/lib/abstractBase.d.ts +10 -16
- package/dist/types/src/lib/basebuilder.d.ts +3 -3
- package/dist/types/src/lib/classBuilder.d.ts +2 -2
- package/dist/types/src/lib/core.d.ts +2 -2
- package/dist/types/src/lib/index.d.ts +7 -6
- package/dist/types/src/lib/types.d.ts +8 -8
- package/dist/types/src/mothership/test.d.ts +2 -2
- package/dist/types/src/utils/buildTemplates.d.ts +3 -0
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/docs/index.md +567 -0
- package/docs/style.md +116 -0
- package/docs.html +537 -0
- package/example.css +351 -0
- package/fonts/M_PLUS_Rounded_1c/MPLUSRounded1c-Black.ttf +0 -0
- package/fonts/M_PLUS_Rounded_1c/MPLUSRounded1c-Bold.ttf +0 -0
- package/fonts/M_PLUS_Rounded_1c/MPLUSRounded1c-ExtraBold.ttf +0 -0
- package/fonts/M_PLUS_Rounded_1c/MPLUSRounded1c-Light.ttf +0 -0
- package/fonts/M_PLUS_Rounded_1c/MPLUSRounded1c-Medium.ttf +0 -0
- package/fonts/M_PLUS_Rounded_1c/MPLUSRounded1c-Regular.ttf +0 -0
- package/fonts/M_PLUS_Rounded_1c/MPLUSRounded1c-Thin.ttf +0 -0
- package/fonts/M_PLUS_Rounded_1c/OFL.txt +91 -0
- package/index.html +245 -24
- package/logo.svg +72 -0
- package/package.json +11 -2
- package/scripts/compile-docs.js +89 -0
- package/src/CoreTypes.ts +152 -0
- package/src/Init.ts +4 -4
- package/src/Node.ts +13 -13
- package/src/PM/PM_WithEslintAndTsc.ts +46 -15
- package/src/PM/__tests__/nodeSidecar.testeranto.ts +13 -20
- package/src/PM/__tests__/pureSidecar.testeranto.ts +8 -15
- package/src/PM/__tests__/webSidecar.testeranto.ts +8 -15
- package/src/PM/index.ts +1 -1
- package/src/PM/main.ts +17 -16
- package/src/PM/node.ts +10 -10
- package/src/PM/nodeSidecar.ts +2 -2
- package/src/PM/pure.ts +0 -4
- package/src/Project.tsx +289 -292
- package/src/Pure.ts +13 -14
- package/src/PureSidecar.ts +1 -0
- package/src/TestReport.tsx +179 -165
- package/src/Types.ts +52 -151
- package/src/Web.ts +15 -14
- package/src/build.ts +22 -72
- package/src/defaultConfig.ts +2 -1
- package/src/esbuildConfigs/eslint-formatter-testeranto.ts +17 -1
- package/src/esbuildConfigs/node.ts +2 -18
- package/src/esbuildConfigs/pure.ts +2 -18
- package/src/esbuildConfigs/rebuildPlugin.ts +23 -0
- package/src/esbuildConfigs/web.ts +2 -18
- package/src/lib/BaseSuite.test.ts +457 -0
- package/src/lib/BaseSuite.ts +155 -0
- package/src/lib/abstractBase.ts +13 -163
- package/src/lib/basebuilder.ts +11 -11
- package/src/lib/classBuilder.ts +13 -7
- package/src/lib/core.ts +13 -17
- package/src/lib/index.ts +21 -24
- package/src/lib/types.ts +23 -9
- package/src/mothership/test.ts +13 -10
- package/src/run.ts +1 -1
- package/src/style.css +1 -1
- package/src/utils/buildTemplates.ts +88 -0
- package/style.css +496 -0
- package/testeranto/bundles/node/{mothership/chunk-V2EQEXU2.mjs → allTests/chunk-4PJCC2XT.mjs} +66 -59
- package/testeranto/bundles/node/allTests/metafile.json +4151 -0
- package/testeranto/bundles/node/allTests/src/PM/__tests__/nodeSidecar.testeranto.mjs +187 -0
- package/testeranto/bundles/node/{mothership → allTests}/src/PM/__tests__/pureSidecar.testeranto.mjs +1 -1
- package/testeranto/bundles/node/{mothership → allTests}/src/PM/__tests__/webSidecar.testeranto.mjs +1 -1
- package/testeranto/bundles/node/allTests/src/lib/BaseSuite.test.mjs +305 -0
- package/testeranto/bundles/node/{mothership → allTests}/src/mothership/test.mjs +1 -1
- package/testeranto/dev.html +29 -0
- package/testeranto/index.html +28 -27
- package/testeranto/reports/allTests/config.json +57 -0
- package/testeranto/reports/{mothership/index.html → allTests/dev.html} +2 -0
- package/testeranto/reports/allTests/index.html +26 -0
- package/testeranto/reports/{mothership/src/PM/__tests__/sidecar.testeranto/node/index.html → allTests/src/PM/__tests__/nodeSidecar.testeranto/node/dev.html} +4 -3
- package/testeranto/reports/allTests/src/PM/__tests__/nodeSidecar.testeranto/node/index.html +21 -0
- package/testeranto/reports/allTests/src/PM/__tests__/nodeSidecar.testeranto/node/lint_errors.json +80 -0
- package/testeranto/reports/allTests/src/PM/__tests__/nodeSidecar.testeranto/node/message +1 -0
- package/testeranto/reports/allTests/src/PM/__tests__/nodeSidecar.testeranto/node/prompt.txt +8 -0
- package/testeranto/reports/allTests/src/PM/__tests__/nodeSidecar.testeranto/node/type_errors.txt +28 -0
- package/testeranto/reports/{mothership/src/PM/__tests__/webSidecar.testeranto/node/index.html → allTests/src/PM/__tests__/pureSidecar.testeranto/node/dev.html} +4 -3
- package/testeranto/reports/allTests/src/PM/__tests__/pureSidecar.testeranto/node/index.html +21 -0
- package/testeranto/reports/{mothership → allTests}/src/PM/__tests__/pureSidecar.testeranto/node/lint_errors.json +12 -12
- package/testeranto/reports/allTests/src/PM/__tests__/pureSidecar.testeranto/node/message +1 -0
- package/testeranto/reports/allTests/src/PM/__tests__/pureSidecar.testeranto/node/prompt.txt +8 -0
- package/testeranto/reports/allTests/src/PM/__tests__/pureSidecar.testeranto/node/type_errors.txt +32 -0
- package/testeranto/reports/{mothership/src/PM/__tests__/nodeSidecar.testeranto/node/index.html → allTests/src/PM/__tests__/webSidecar.testeranto/node/dev.html} +4 -3
- package/testeranto/reports/allTests/src/PM/__tests__/webSidecar.testeranto/node/index.html +21 -0
- package/testeranto/reports/{mothership → allTests}/src/PM/__tests__/webSidecar.testeranto/node/lint_errors.json +12 -12
- package/testeranto/reports/allTests/src/PM/__tests__/webSidecar.testeranto/node/message +1 -0
- package/testeranto/reports/allTests/src/PM/__tests__/webSidecar.testeranto/node/prompt.txt +8 -0
- package/testeranto/reports/allTests/src/PM/__tests__/webSidecar.testeranto/node/type_errors.txt +32 -0
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/node/console_log.txt +35 -0
- package/testeranto/reports/{mothership/src/PM/__tests__/pureSidecar.testeranto/node/index.html → allTests/src/lib/BaseSuite.test/node/dev.html} +4 -3
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/node/index.html +21 -0
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/node/lint_errors.json +608 -0
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/node/message +1 -0
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/node/prompt.txt +7 -0
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/node/type_errors.txt +68 -0
- package/testeranto/reports/allTests/src/mothership/test/node/dev.html +21 -0
- package/testeranto/reports/allTests/src/mothership/test/node/index.html +21 -0
- package/testeranto/reports/allTests/src/mothership/test/node/message +1 -0
- package/testeranto/reports/allTests/src/mothership/test/node/prompt.txt +8 -0
- package/testeranto/reports/allTests/src/mothership/test/node/type_errors.txt +24 -0
- package/testeranto/reports/allTests/summary.json +37 -0
- package/testeranto.config.ts +16 -26
- package/tsc.log +66 -69
- package/.aider.tags.cache.v3/cache.db-shm +0 -0
- package/.aider.tags.cache.v3/cache.db-wal +0 -0
- package/dist/common/src/SP__Polygon.test.js +0 -10
- package/dist/module/src/ReportClient.js +0 -132
- package/dist/module/src/SP__Polygon.test.js +0 -8
- package/dist/prebuild/ReportClient.js +0 -3
- package/src/ReportClient.tsx +0 -164
- package/src/SP__Polygon.test.ts +0 -13
- package/testeranto/ReportClient.css +0 -11367
- package/testeranto/ReportClient.js +0 -24641
- package/testeranto/bundles/node/mothership/metafile.json +0 -389
- package/testeranto/bundles/node/mothership/src/PM/__tests__/nodeSidecar.testeranto.mjs +0 -1219
- package/testeranto/bundles/node/mothership/src/PM/__tests__/sidecar.testeranto.mjs +0 -1199
- package/testeranto/reports/mothership/config.json +0 -25
- package/testeranto/reports/mothership/src/PM/__tests__/nodeSidecar.testeranto/node/console_log.txt +0 -0
- package/testeranto/reports/mothership/src/PM/__tests__/nodeSidecar.testeranto/node/lint_errors.json +0 -1564
- package/testeranto/reports/mothership/src/PM/__tests__/nodeSidecar.testeranto/node/prompt.txt +0 -22
- package/testeranto/reports/mothership/src/PM/__tests__/nodeSidecar.testeranto/node/type_errors.txt +0 -35
- package/testeranto/reports/mothership/src/PM/__tests__/pureSidecar.testeranto/node/prompt.txt +0 -12
- package/testeranto/reports/mothership/src/PM/__tests__/pureSidecar.testeranto/node/type_errors.txt +0 -26
- package/testeranto/reports/mothership/src/PM/__tests__/sidecar.testeranto/node/bdd_errors.txt +0 -1
- package/testeranto/reports/mothership/src/PM/__tests__/sidecar.testeranto/node/console_log.txt +0 -0
- package/testeranto/reports/mothership/src/PM/__tests__/sidecar.testeranto/node/lint_errors.json +0 -1564
- package/testeranto/reports/mothership/src/PM/__tests__/sidecar.testeranto/node/log.txt +0 -0
- package/testeranto/reports/mothership/src/PM/__tests__/sidecar.testeranto/node/prompt.txt +0 -22
- package/testeranto/reports/mothership/src/PM/__tests__/sidecar.testeranto/node/tests.json +0 -56
- package/testeranto/reports/mothership/src/PM/__tests__/sidecar.testeranto/node/type_errors.txt +0 -29
- package/testeranto/reports/mothership/src/PM/__tests__/webSidecar.testeranto/node/prompt.txt +0 -12
- package/testeranto/reports/mothership/src/PM/__tests__/webSidecar.testeranto/node/type_errors.txt +0 -26
- package/testeranto/reports/mothership/src/mothership/test/node/bdd_errors.txt +0 -1
- package/testeranto/reports/mothership/src/mothership/test/node/console_log.txt +0 -4
- package/testeranto/reports/mothership/src/mothership/test/node/index.html +0 -20
- package/testeranto/reports/mothership/src/mothership/test/node/log.txt +0 -0
- package/testeranto/reports/mothership/src/mothership/test/node/prompt.txt +0 -12
- package/testeranto/reports/mothership/src/mothership/test/node/tests.json +0 -24
- package/testeranto/reports/mothership/src/mothership/test/node/type_errors.txt +0 -18
- package/testeranto/reports/mothership/summary.json +0 -9
- /package/dist/{types/src/SP__Polygon.test.d.ts → module/src/CoreTypes.js} +0 -0
- /package/testeranto/bundles/node/{mothership → allTests}/chunk-PG6KUKNP.mjs +0 -0
- /package/testeranto/bundles/pure/{mothership → allTests}/metafile.json +0 -0
- /package/testeranto/bundles/web/{mothership → allTests}/metafile.json +0 -0
- /package/testeranto/reports/{mothership/src/PM/__tests__/nodeSidecar.testeranto → allTests/src/lib/BaseSuite.test}/node/log.txt +0 -0
- /package/testeranto/reports/{mothership → allTests}/src/mothership/test/node/lint_errors.json +0 -0
|
@@ -29,7 +29,7 @@ export declare abstract class PM {
|
|
|
29
29
|
abstract typeInto(selector: string, value: string): any;
|
|
30
30
|
abstract waitForSelector(p: any, sel: string): any;
|
|
31
31
|
abstract write(uid: number, contents: string): Promise<boolean>;
|
|
32
|
-
abstract writeFileSync(f: string, c: string
|
|
32
|
+
abstract writeFileSync(f: string, c: string): Promise<boolean>;
|
|
33
33
|
abstract launchSideCar(n: number): Promise<[number, ITTestResourceConfiguration]>;
|
|
34
34
|
abstract stopSideCar(n: number): Promise<any>;
|
|
35
35
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import net from "net";
|
|
2
|
-
import { ITTestResourceConfiguration } from "../lib";
|
|
2
|
+
import { ITLog, ITTestResourceConfiguration } from "../lib";
|
|
3
3
|
import { PM_sidecar } from "./sidecar";
|
|
4
|
+
import { PassThrough } from "stream";
|
|
4
5
|
export declare class PM_Node_Sidecar extends PM_sidecar {
|
|
5
6
|
testResourceConfiguration: ITTestResourceConfiguration;
|
|
6
7
|
client: net.Socket;
|
|
7
|
-
mockListener?: jest.Mock;
|
|
8
8
|
constructor(t: ITTestResourceConfiguration);
|
|
9
9
|
start(stopper: () => any): Promise<void>;
|
|
10
10
|
stop(): Promise<void>;
|
package/dist/types/src/Pure.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { Ibdd_in_any, Ibdd_out, ITestImplementation, ITestInterface, ITestSpecification } from "./CoreTypes.js";
|
|
1
2
|
import Testeranto from "./lib/core.js";
|
|
2
3
|
import { ITTestResourceRequest } from "./lib/index.js";
|
|
3
|
-
|
|
4
|
-
export declare class PureTesteranto<I extends IT, O extends OT, M> extends Testeranto<I, O, M> {
|
|
4
|
+
export declare class PureTesteranto<I extends Ibdd_in_any, O extends Ibdd_out, M> extends Testeranto<I, O, M> {
|
|
5
5
|
constructor(input: I["iinput"], testSpecification: ITestSpecification<I, O>, testImplementation: ITestImplementation<I, O, M>, testResourceRequirement: ITTestResourceRequest, testInterface: Partial<ITestInterface<I>>);
|
|
6
6
|
receiveTestResourceConfig(partialTestResource: string): Promise<import("./lib/index.js").IFinalResults>;
|
|
7
7
|
}
|
|
8
|
-
declare const _default: <I extends
|
|
8
|
+
declare const _default: <I extends Ibdd_in_any, O extends Ibdd_out, M>(input: I["iinput"], testSpecification: ITestSpecification<I, O>, testImplementation: ITestImplementation<I, O, M>, testInterface: Partial<INodeTestInterface<I>>, testResourceRequirement?: ITTestResourceRequest) => Promise<Testeranto<I, O, M>>;
|
|
9
9
|
export default _default;
|
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
import { Plugin } from "esbuild";
|
|
2
2
|
import { ITTestResourceConfiguration } from "./lib/index.js";
|
|
3
3
|
import { PM } from "./PM/index.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
4
|
+
import { BaseWhen, BaseThen, BaseGiven, BaseCheck, BaseSuite, IGivens } from "./lib/abstractBase.js";
|
|
5
|
+
import { Ibdd_in_any, Ibdd_out_any } from "./CoreTypes.js";
|
|
6
|
+
export type ISummary = Record<string, {
|
|
7
|
+
runTimeError: string;
|
|
8
|
+
typeErrors: number;
|
|
9
|
+
staticErrors: number;
|
|
10
|
+
prompt: string;
|
|
11
|
+
failingFeatures: object;
|
|
12
|
+
}>;
|
|
13
|
+
export type SuiteSpecification<I extends Ibdd_in_any, O extends Ibdd_out_any> = {
|
|
14
|
+
[K in keyof O["suites"]]: (name: string, givens: IGivens<I>, checks: BaseCheck<I>[]) => BaseSuite<I, O>;
|
|
15
|
+
};
|
|
7
16
|
export type TestSummary = {
|
|
8
17
|
testName: string;
|
|
9
18
|
errors?: {
|
|
@@ -49,82 +58,36 @@ export type ProjectConfig = {
|
|
|
49
58
|
minify?: boolean;
|
|
50
59
|
debug?: boolean;
|
|
51
60
|
};
|
|
52
|
-
export type
|
|
53
|
-
[K in keyof O["suites"]]: (name: string, givens: IGivens<I>, checks: BaseCheck<I>[]) => BaseSuite<I, O>;
|
|
54
|
-
};
|
|
55
|
-
export type GivenSpecification<I extends IT, O extends OT> = {
|
|
61
|
+
export type GivenSpecification<I extends Ibdd_in_any, O extends Ibdd_out_any> = {
|
|
56
62
|
[K in keyof O["givens"]]: (features: string[], whens: BaseWhen<I>[], thens: BaseThen<I>[], ...xtrasB: O["givens"][K]) => BaseGiven<I>;
|
|
57
63
|
};
|
|
58
|
-
export type WhenSpecification<I extends
|
|
64
|
+
export type WhenSpecification<I extends Ibdd_in_any, O extends Ibdd_out_any> = {
|
|
59
65
|
[K in keyof O["whens"]]: (...xtrasC: O["whens"][K]) => BaseWhen<I>;
|
|
60
66
|
};
|
|
61
|
-
export type ThenSpecification<I extends
|
|
67
|
+
export type ThenSpecification<I extends Ibdd_in_any, O extends Ibdd_out_any> = {
|
|
62
68
|
[K in keyof O["thens"]]: (...xtrasD: O["thens"][K]) => BaseThen<I>;
|
|
63
69
|
};
|
|
64
|
-
export type
|
|
65
|
-
export type TestSuiteImplementation<O extends OT> = {
|
|
70
|
+
export type TestSuiteImplementation<O extends Ibdd_out_any> = {
|
|
66
71
|
[K in keyof O["suites"]]: string;
|
|
67
72
|
};
|
|
68
|
-
export type TestGivenImplementation<I extends
|
|
73
|
+
export type TestGivenImplementation<I extends Ibdd_in_any, O extends Ibdd_out_any> = {
|
|
69
74
|
[K in keyof O["givens"]]: (...Ig: O["givens"][K]) => I["given"];
|
|
70
75
|
};
|
|
71
|
-
export type TestWhenImplementation<I extends
|
|
76
|
+
export type TestWhenImplementation<I extends Ibdd_in_any, O extends Ibdd_out_any> = {
|
|
72
77
|
[K in keyof O["whens"]]: (...Iw: O["whens"][K]) => (zel: I["iselection"], tr: ITTestResourceConfiguration, utils: PM) => Promise<I["when"]>;
|
|
73
78
|
};
|
|
74
|
-
export type TestThenImplementation<I extends
|
|
79
|
+
export type TestThenImplementation<I extends Ibdd_in_any, O extends Ibdd_out_any> = {
|
|
75
80
|
[K in keyof O["thens"]]: (...It: O["thens"][K]) => (ssel: I["iselection"], utils: PM) => I["then"];
|
|
76
81
|
};
|
|
77
|
-
export type TestCheckImplementation<I extends
|
|
82
|
+
export type TestCheckImplementation<I extends Ibdd_in_any, O extends Ibdd_out_any> = {
|
|
78
83
|
[K in keyof O["checks"]]: (...Ic: O["checks"][K]) => I["given"];
|
|
79
84
|
};
|
|
80
|
-
export type ITestImplementation<I extends IT, O extends OT, modifier = {
|
|
81
|
-
whens: TestWhenImplementation<I, O>;
|
|
82
|
-
}> = Modify<{
|
|
83
|
-
suites: TestSuiteImplementation<O>;
|
|
84
|
-
givens: TestGivenImplementation<I, O>;
|
|
85
|
-
whens: TestWhenImplementation<I, O>;
|
|
86
|
-
thens: TestThenImplementation<I, O>;
|
|
87
|
-
checks: TestCheckImplementation<I, O>;
|
|
88
|
-
}, modifier>;
|
|
89
85
|
export type Modify<T, R> = Omit<T, keyof R> & R;
|
|
90
86
|
export type TestSuiteShape = Record<string, any>;
|
|
91
87
|
export type TestGivenShape = Record<string, any>;
|
|
92
88
|
export type TestWhenShape = Record<string, any>;
|
|
93
89
|
export type TestThenShape = Record<string, any>;
|
|
94
90
|
export type TestCheckShape = Record<string, any>;
|
|
95
|
-
export type Ibdd_out<ISuites extends TestSuiteShape = TestSuiteShape, IGivens extends TestGivenShape = TestGivenShape, IWhens extends TestWhenShape = TestWhenShape, IThens extends TestThenShape = TestThenShape, IChecks extends TestCheckShape = TestCheckShape> = {
|
|
96
|
-
suites: ISuites;
|
|
97
|
-
givens: IGivens;
|
|
98
|
-
whens: IWhens;
|
|
99
|
-
thens: IThens;
|
|
100
|
-
checks: IChecks;
|
|
101
|
-
};
|
|
102
|
-
/**
|
|
103
|
-
* Defines the input shape for BDD test definitions.
|
|
104
|
-
* This is the core type that structures all test operations.
|
|
105
|
-
*/
|
|
106
|
-
export type Ibdd_in<IInput, // Type of initial test input
|
|
107
|
-
ISubject, // Type of object being tested
|
|
108
|
-
IStore, // Type for storing test state between steps
|
|
109
|
-
ISelection, // Type for selecting state for assertions
|
|
110
|
-
IGiven, // Type for Given step functions
|
|
111
|
-
IWhen, // Type for When step functions
|
|
112
|
-
IThen> = {
|
|
113
|
-
/** Initial input required to start tests */
|
|
114
|
-
iinput: IInput;
|
|
115
|
-
/** The subject being tested (class, function, etc) */
|
|
116
|
-
isubject: ISubject;
|
|
117
|
-
/** Complete test state storage */
|
|
118
|
-
istore: IStore;
|
|
119
|
-
/** Selected portion of state for assertions */
|
|
120
|
-
iselection: ISelection;
|
|
121
|
-
/** Function type for Given steps */
|
|
122
|
-
given: IGiven;
|
|
123
|
-
/** Function type for When steps */
|
|
124
|
-
when: IWhen;
|
|
125
|
-
/** Function type for Then steps */
|
|
126
|
-
then: IThen;
|
|
127
|
-
};
|
|
128
91
|
export type IPluginFactory = (register?: (entrypoint: string, sources: string[]) => any, entrypoints?: string[]) => Plugin;
|
|
129
92
|
export type IRunTime = `node` | `web` | "pure" | `spawn`;
|
|
130
93
|
export type ITestTypes = [string, IRunTime, {
|
|
@@ -134,10 +97,6 @@ export type ITestconfig = {
|
|
|
134
97
|
clearScreen: boolean;
|
|
135
98
|
debugger: boolean;
|
|
136
99
|
externals: string[];
|
|
137
|
-
externalTests: Record<string, {
|
|
138
|
-
watch: string[];
|
|
139
|
-
exec: string;
|
|
140
|
-
}>;
|
|
141
100
|
featureIngestor: (s: string) => Promise<string>;
|
|
142
101
|
importPlugins: IPluginFactory[];
|
|
143
102
|
minify: boolean;
|
|
@@ -152,4 +111,5 @@ export type IBuiltConfig = {
|
|
|
152
111
|
} & ITestconfig;
|
|
153
112
|
export type IProject = {
|
|
154
113
|
projects: Record<string, ITestconfig>;
|
|
114
|
+
reportDomain: string;
|
|
155
115
|
};
|
package/dist/types/src/Web.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ITestSpecification, ITestImplementation, ITestInterface, Ibdd_in_any, Ibdd_out } from "./CoreTypes";
|
|
2
2
|
import Testeranto from "./lib/core.js";
|
|
3
3
|
import { ITTestResourceRequest } from "./lib/index.js";
|
|
4
|
-
export declare class WebTesteranto<I extends
|
|
4
|
+
export declare class WebTesteranto<I extends Ibdd_in_any, O extends Ibdd_out, M> extends Testeranto<I, O, M> {
|
|
5
5
|
constructor(input: I["iinput"], testSpecification: ITestSpecification<I, O>, testImplementation: ITestImplementation<I, O, M>, testResourceRequirement: ITTestResourceRequest, testInterface: Partial<ITestInterface<I>>);
|
|
6
6
|
receiveTestResourceConfig(partialTestResource: any): Promise<import("./lib/index.js").IFinalResults>;
|
|
7
7
|
}
|
|
8
|
-
declare const _default: <I extends
|
|
8
|
+
declare const _default: <I extends Ibdd_in_any, O extends Ibdd_out, M>(input: I["iinput"], testSpecification: ITestSpecification<I, O>, testImplementation: ITestImplementation<I, O, M>, testInterface: Partial<IWebTestInterface<I>>, testResourceRequirement?: ITTestResourceRequest) => Promise<Testeranto<I, O, M>>;
|
|
9
9
|
export default _default;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { ITTestResourceConfiguration, ITestArtifactory, ITLog } from ".";
|
|
1
|
+
import { ITestArtifactory, ITLog, ITTestResourceConfiguration } from ".";
|
|
3
2
|
import { IPM } from "./types.js";
|
|
4
|
-
|
|
5
|
-
export
|
|
3
|
+
import type { Ibdd_in_any, Ibdd_out_any } from "../CoreTypes";
|
|
4
|
+
export type IGivens<I extends Ibdd_in_any> = Record<string, BaseGiven<I>>;
|
|
5
|
+
export declare abstract class BaseSuite<I extends Ibdd_in_any, O extends Ibdd_out_any> {
|
|
6
6
|
name: string;
|
|
7
7
|
givens: IGivens<I>;
|
|
8
8
|
checks: BaseCheck<I>[];
|
|
@@ -18,10 +18,7 @@ export declare abstract class BaseSuite<I extends IT = IT, O extends OT = OT> {
|
|
|
18
18
|
givens: {
|
|
19
19
|
key: string;
|
|
20
20
|
name: string;
|
|
21
|
-
whens: {
|
|
22
|
-
name: string;
|
|
23
|
-
error: string;
|
|
24
|
-
}[];
|
|
21
|
+
whens: {}[];
|
|
25
22
|
thens: {
|
|
26
23
|
name: string;
|
|
27
24
|
error: boolean;
|
|
@@ -40,7 +37,7 @@ export declare abstract class BaseSuite<I extends IT = IT, O extends OT = OT> {
|
|
|
40
37
|
afterAll(store: I["istore"], artifactory: ITestArtifactory, pm: IPM): I["istore"];
|
|
41
38
|
run(input: I["iinput"], testResourceConfiguration: ITTestResourceConfiguration, artifactory: (fPath: string, value: unknown) => void, tLog: (...string: any[]) => void, pm: IPM): Promise<BaseSuite<I, O>>;
|
|
42
39
|
}
|
|
43
|
-
export declare abstract class BaseGiven<I extends
|
|
40
|
+
export declare abstract class BaseGiven<I extends Ibdd_in_any> {
|
|
44
41
|
name: string;
|
|
45
42
|
features: string[];
|
|
46
43
|
whens: BaseWhen<I>[];
|
|
@@ -58,10 +55,7 @@ export declare abstract class BaseGiven<I extends IT = IT> {
|
|
|
58
55
|
toObj(): {
|
|
59
56
|
key: string;
|
|
60
57
|
name: string;
|
|
61
|
-
whens: {
|
|
62
|
-
name: string;
|
|
63
|
-
error: string;
|
|
64
|
-
}[];
|
|
58
|
+
whens: {}[];
|
|
65
59
|
thens: {
|
|
66
60
|
name: string;
|
|
67
61
|
error: boolean;
|
|
@@ -75,7 +69,7 @@ export declare abstract class BaseGiven<I extends IT = IT> {
|
|
|
75
69
|
abstract uberCatcher(e: any): any;
|
|
76
70
|
give(subject: I["isubject"], key: string, testResourceConfiguration: ITTestResourceConfiguration, tester: (t: Awaited<I["then"]> | undefined) => boolean, artifactory: ITestArtifactory, tLog: ITLog, pm: IPM, suiteNdx: number): Promise<I["istore"]>;
|
|
77
71
|
}
|
|
78
|
-
export declare abstract class BaseWhen<I extends
|
|
72
|
+
export declare abstract class BaseWhen<I extends Ibdd_in_any> {
|
|
79
73
|
name: string;
|
|
80
74
|
whenCB: (x: I["iselection"]) => I["then"];
|
|
81
75
|
error: Error;
|
|
@@ -87,7 +81,7 @@ export declare abstract class BaseWhen<I extends IT> {
|
|
|
87
81
|
};
|
|
88
82
|
test(store: I["istore"], testResourceConfiguration: any, tLog: ITLog, pm: IPM, filepath: string): Promise<any>;
|
|
89
83
|
}
|
|
90
|
-
export declare abstract class BaseThen<I extends
|
|
84
|
+
export declare abstract class BaseThen<I extends Ibdd_in_any> {
|
|
91
85
|
name: string;
|
|
92
86
|
thenCB: (storeState: I["iselection"]) => Promise<I["then"]>;
|
|
93
87
|
error: boolean;
|
|
@@ -100,7 +94,7 @@ export declare abstract class BaseThen<I extends IT> {
|
|
|
100
94
|
test(store: I["istore"], testResourceConfiguration: any, tLog: ITLog, pm: IPM, filepath: string): Promise<I["then"] | undefined>;
|
|
101
95
|
check(): void;
|
|
102
96
|
}
|
|
103
|
-
export declare abstract class BaseCheck<I extends
|
|
97
|
+
export declare abstract class BaseCheck<I extends Ibdd_in_any> {
|
|
104
98
|
key: string;
|
|
105
99
|
name: string;
|
|
106
100
|
features: string[];
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { Ibdd_in_any, Ibdd_out_any, ITestSpecification } from "../CoreTypes";
|
|
2
|
+
import { ITestJob, ITTestResourceRequest } from ".";
|
|
3
3
|
import { ISuiteKlasser, IGivenKlasser, IWhenKlasser, IThenKlasser, ICheckKlasser, IPM } from "./types.js";
|
|
4
4
|
import { BaseCheck, BaseWhen, BaseThen, BaseGiven } from "./abstractBase.js";
|
|
5
|
-
export declare abstract class BaseBuilder<I extends
|
|
5
|
+
export declare abstract class BaseBuilder<I extends Ibdd_in_any, O extends Ibdd_out_any, SuiteExtensions, GivenExtensions, WhenExtensions, ThenExtensions, CheckExtensions> {
|
|
6
6
|
specs: any;
|
|
7
7
|
assertThis: (t: I["then"]) => {};
|
|
8
8
|
testResourceRequirement: ITTestResourceRequest;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Ibdd_in_any, Ibdd_out_any, ITestImplementation, ITestSpecification } from "../CoreTypes";
|
|
2
2
|
import { BaseBuilder } from "./basebuilder.js";
|
|
3
3
|
import { ISuiteKlasser, IGivenKlasser, IWhenKlasser, IThenKlasser, ICheckKlasser } from "./types.js";
|
|
4
4
|
import { ITTestResourceRequest } from "./index.js";
|
|
5
5
|
type IExtenstions = Record<string, unknown>;
|
|
6
|
-
export declare abstract class ClassBuilder<I extends
|
|
6
|
+
export declare abstract class ClassBuilder<I extends Ibdd_in_any = Ibdd_in_any, O extends Ibdd_out_any = Ibdd_out_any, M = unknown> extends BaseBuilder<I, O, IExtenstions, IExtenstions, IExtenstions, IExtenstions, IExtenstions> {
|
|
7
7
|
constructor(testImplementation: ITestImplementation<I, O, M> & {
|
|
8
8
|
suites: Record<string, any>;
|
|
9
9
|
givens: Record<string, any>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ITestSpecification, ITestImplementation, ITestInterface, IT, OT } from "../Types.js";
|
|
2
1
|
import { IFinalResults, ITTestResourceRequest } from "./index.js";
|
|
3
2
|
import { ClassBuilder } from "./classBuilder.js";
|
|
4
|
-
|
|
3
|
+
import type { Ibdd_in_any, Ibdd_out_any, ITestImplementation, ITestInterface, ITestSpecification } from "../CoreTypes";
|
|
4
|
+
export default abstract class Testeranto<I extends Ibdd_in_any, O extends Ibdd_out_any, M> extends ClassBuilder<I, O, M> {
|
|
5
5
|
constructor(input: I["iinput"], testSpecification: ITestSpecification<I, O>, testImplementation: ITestImplementation<I, O, M> & {
|
|
6
6
|
suites: Record<string, any>;
|
|
7
7
|
givens: Record<string, any>;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { PM_Pure } from "../PM/pure.js";
|
|
2
2
|
import { PM_Node } from "../PM/node.js";
|
|
3
3
|
import { PM_Web } from "../PM/web.js";
|
|
4
|
-
import {
|
|
4
|
+
import { ITestconfig, IBuiltConfig, IRunTime, ITestTypes } from "../Types.js";
|
|
5
5
|
import { IGivens, BaseCheck, BaseSuite } from "./abstractBase.js";
|
|
6
|
-
|
|
7
|
-
export declare const
|
|
6
|
+
import type { ITestInterface, Ibdd_in_any, Ibdd_out_any } from "../CoreTypes.js";
|
|
7
|
+
export declare const BaseTestInterface: <T extends Ibdd_in_any>() => ITestInterface<T>;
|
|
8
|
+
export declare const DefaultTestInterface: <T extends Ibdd_in_any>(p: Partial<ITestInterface<T>>) => ITestInterface<T>;
|
|
8
9
|
export type ITTestResourceConfiguration = {
|
|
9
10
|
name: string;
|
|
10
11
|
fs: string;
|
|
@@ -33,14 +34,14 @@ export type ITestArtificer = (key: string, data: any) => void;
|
|
|
33
34
|
type ITest = {
|
|
34
35
|
toObj(): object;
|
|
35
36
|
name: string;
|
|
36
|
-
givens: IGivens<
|
|
37
|
-
checks: BaseCheck<
|
|
37
|
+
givens: IGivens<Ibdd_in_any>;
|
|
38
|
+
checks: BaseCheck<Ibdd_in_any>[];
|
|
38
39
|
testResourceConfiguration: ITTestResourceConfiguration;
|
|
39
40
|
};
|
|
40
41
|
export type ITestJob = {
|
|
41
42
|
toObj(): object;
|
|
42
43
|
test: ITest;
|
|
43
|
-
runner: (x: ITTestResourceConfiguration, t: ITLog) => Promise<BaseSuite<
|
|
44
|
+
runner: (x: ITTestResourceConfiguration, t: ITLog) => Promise<BaseSuite<Ibdd_in_any, Ibdd_out_any>>;
|
|
44
45
|
testResourceRequirement: ITTestResourceRequirement;
|
|
45
46
|
receiveTestResourceConfig: (pm: PM_Node | PM_Web | PM_Pure) => IFinalResults;
|
|
46
47
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import type { Ibdd_in_any, Ibdd_out_any } from "../CoreTypes";
|
|
1
2
|
import { PM_Node } from "../PM/node";
|
|
2
3
|
import { PM_Pure } from "../PM/pure";
|
|
3
4
|
import { PM_Web } from "../PM/web";
|
|
4
|
-
import type { IT, OT } from "../Types";
|
|
5
5
|
import { IGivens, BaseCheck, BaseSuite, BaseGiven, BaseWhen, BaseThen } from "./abstractBase";
|
|
6
6
|
export type IPM = PM_Node | PM_Web | PM_Pure;
|
|
7
|
-
export type TestPhase =
|
|
7
|
+
export type TestPhase = "beforeAll" | "beforeEach" | "test" | "afterEach" | "afterAll";
|
|
8
8
|
export type TestError = {
|
|
9
9
|
phase: TestPhase;
|
|
10
10
|
error: Error;
|
|
@@ -14,11 +14,11 @@ export type TestError = {
|
|
|
14
14
|
additionalInfo?: Record<string, unknown>;
|
|
15
15
|
isRetryable?: boolean;
|
|
16
16
|
};
|
|
17
|
-
export type ITestCheckCallback<I extends
|
|
17
|
+
export type ITestCheckCallback<I extends Ibdd_in_any, O extends Ibdd_out_any> = {
|
|
18
18
|
[K in keyof O["checks"]]: (name: string, features: string[], checkCallback: (store: I["istore"], pm: IPM) => Promise<O["checks"][K]>, ...xtrasA: O["checks"][K]) => BaseCheck<I>;
|
|
19
19
|
};
|
|
20
|
-
export type ISuiteKlasser<I extends
|
|
21
|
-
export type IGivenKlasser<I extends
|
|
22
|
-
export type IWhenKlasser<I extends
|
|
23
|
-
export type IThenKlasser<I extends
|
|
24
|
-
export type ICheckKlasser<I extends
|
|
20
|
+
export type ISuiteKlasser<I extends Ibdd_in_any, O extends Ibdd_out_any> = (name: string, index: number, givens: IGivens<I>, checks: BaseCheck<I>[]) => BaseSuite<I, O>;
|
|
21
|
+
export type IGivenKlasser<I extends Ibdd_in_any> = (name: any, features: any, whens: any, thens: any, givenCB: any) => BaseGiven<I>;
|
|
22
|
+
export type IWhenKlasser<I extends Ibdd_in_any> = (s: any, o: any) => BaseWhen<I>;
|
|
23
|
+
export type IThenKlasser<I extends Ibdd_in_any> = (s: any, o: any) => BaseThen<I>;
|
|
24
|
+
export type ICheckKlasser<I extends Ibdd_in_any> = (n: any, f: any, cb: any, w: any, t: any) => BaseCheck<I>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Ibdd_out,
|
|
1
|
+
import { Ibdd_in, Ibdd_out, Ibdd_in_any } from "../CoreTypes";
|
|
2
2
|
import type { Express } from "express";
|
|
3
3
|
type I = Ibdd_in<(port: number) => Express, (port: number) => Express, any, any, any, any, any>;
|
|
4
4
|
type O = Ibdd_out<{
|
|
@@ -15,7 +15,7 @@ type O = Ibdd_out<{
|
|
|
15
15
|
}, {
|
|
16
16
|
AnEmptyState: any;
|
|
17
17
|
}>;
|
|
18
|
-
declare const _default: Promise<import("../lib/core").default<
|
|
18
|
+
declare const _default: Promise<import("../lib/core").default<Ibdd_in_any, O, {
|
|
19
19
|
whens: import("../Types").TestWhenImplementation<I, O>;
|
|
20
20
|
}>>;
|
|
21
21
|
export default _default;
|