testeranto.tiposkripto 0.3.2 → 0.4.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/.DS_Store +0 -0
- package/dist/module/Node.js +1394 -824
- package/dist/module/Web.js +1405 -825
- package/dist/module/index.js +243 -841
- package/dist/types/Types.d.ts +55 -10
- package/dist/types/lib/tiposkripto/src/Adapters.d.ts +3 -0
- package/dist/types/lib/tiposkripto/src/BaseExpected.d.ts +1 -1
- package/dist/types/lib/tiposkripto/src/BaseTiposkripto.d.ts +22 -18
- package/dist/types/lib/tiposkripto/src/CoreTypes.d.ts +27 -28
- package/dist/types/lib/tiposkripto/src/Node.d.ts +4 -4
- package/dist/types/lib/tiposkripto/src/Web.d.ts +9 -3
- package/dist/types/lib/tiposkripto/src/index.d.ts +21 -29
- package/dist/types/lib/tiposkripto/src/interop/index.d.ts +0 -0
- package/dist/types/lib/tiposkripto/src/interop/jest.d.ts +0 -0
- package/dist/types/lib/tiposkripto/src/interop/mocha.d.ts +0 -0
- package/dist/types/lib/tiposkripto/src/interop/nodeNative.d.ts +0 -0
- package/dist/types/lib/tiposkripto/src/interop/vite.d.ts +0 -0
- package/dist/types/lib/tiposkripto/src/types.d.ts +18 -26
- package/dist/types/lib/tiposkripto/src/verbs/BaseSuite.d.ts +0 -0
- package/dist/types/lib/tiposkripto/src/verbs/aaa/BaseDescribe.d.ts +39 -0
- package/dist/types/lib/tiposkripto/src/verbs/aaa/BaseIt.d.ts +22 -0
- package/dist/types/lib/tiposkripto/src/verbs/bdd/BaseGiven.d.ts +48 -0
- package/dist/types/lib/tiposkripto/src/verbs/bdd/BaseThen.d.ts +38 -0
- package/dist/types/lib/tiposkripto/src/verbs/bdd/BaseWhen.d.ts +37 -0
- package/dist/types/lib/tiposkripto/src/verbs/internal/CommonUtils.d.ts +45 -0
- package/dist/types/lib/tiposkripto/src/verbs/tdt/BaseConfirm.d.ts +26 -0
- package/dist/types/lib/tiposkripto/src/verbs/tdt/BaseExpected.d.ts +27 -0
- package/dist/types/lib/tiposkripto/src/verbs/tdt/BaseShould.d.ts +24 -0
- package/dist/types/lib/tiposkripto/src/verbs/tdt/BaseValue.d.ts +38 -0
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/package.json +2 -1
package/dist/types/Types.d.ts
CHANGED
|
@@ -1,22 +1,29 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { BaseThen } from "./lib/tiposkripto/src/BaseThen";
|
|
3
|
-
import { BaseWhen } from "./lib/tiposkripto/src/BaseWhen";
|
|
1
|
+
import type { Plugin } from "esbuild";
|
|
4
2
|
import type { Ibdd_in_any, Ibdd_out_any } from "./lib/tiposkripto/src/CoreTypes";
|
|
5
3
|
import type { ITestResourceConfiguration } from "./lib/tiposkripto/src/types";
|
|
4
|
+
import type { BaseGiven } from "./lib/tiposkripto/src/verbs/bdd/BaseGiven";
|
|
5
|
+
import type { BaseThen } from "./lib/tiposkripto/src/verbs/bdd/BaseThen";
|
|
6
|
+
import type { BaseWhen } from "./lib/tiposkripto/src/verbs/bdd/BaseWhen";
|
|
7
|
+
import type { BaseDescribe } from "./lib/tiposkripto/src/verbs/aaa/BaseDescribe";
|
|
8
|
+
import type { BaseIt } from "./lib/tiposkripto/src/verbs/aaa/BaseIt";
|
|
9
|
+
import type { BaseConfirm } from "./lib/tiposkripto/src/verbs/tdt/BaseConfirm";
|
|
10
|
+
import type { BaseValue } from "./lib/tiposkripto/src/verbs/tdt/BaseValue";
|
|
11
|
+
import type { BaseShould } from "./lib/tiposkripto/src/verbs/tdt/BaseShould";
|
|
6
12
|
export type ITestconfigV2 = {
|
|
13
|
+
volumes: string[];
|
|
7
14
|
featureIngestor: (s: string) => Promise<string>;
|
|
8
15
|
runtimes: Record<string, IBaseTestConfig>;
|
|
9
16
|
documentationGlob?: string;
|
|
10
17
|
stakeholderReactModule?: string;
|
|
11
18
|
};
|
|
12
|
-
export type
|
|
13
|
-
export type
|
|
19
|
+
export type IOtherTest = (x: any) => string;
|
|
20
|
+
export type IOtherTests = IOtherTest[];
|
|
14
21
|
export type IBaseTestConfig = {
|
|
15
22
|
runtime: string;
|
|
16
23
|
tests: string[];
|
|
17
24
|
dockerfile: string;
|
|
18
25
|
buildOptions: string;
|
|
19
|
-
checks:
|
|
26
|
+
checks: IOtherTests;
|
|
20
27
|
outputs: string[];
|
|
21
28
|
buildKitOptions?: {
|
|
22
29
|
cacheMounts?: string[];
|
|
@@ -36,12 +43,12 @@ export type TestSummary = {
|
|
|
36
43
|
failedFeatures: string[];
|
|
37
44
|
};
|
|
38
45
|
export type TestLifecycle<Subject, State, Selection> = {
|
|
39
|
-
|
|
40
|
-
|
|
46
|
+
prepareAll?: (input: any) => Promise<Subject>;
|
|
47
|
+
prepareEach?: (subject: Subject) => Promise<State>;
|
|
41
48
|
executeStep?: (state: State) => Promise<State>;
|
|
42
49
|
verifyStep?: (state: State) => Promise<Selection>;
|
|
43
|
-
|
|
44
|
-
|
|
50
|
+
cleanupEach?: (state: State) => Promise<void>;
|
|
51
|
+
cleanupAll?: (state: State) => Promise<void>;
|
|
45
52
|
assert?: (result: Selection) => void;
|
|
46
53
|
};
|
|
47
54
|
export type GivenSpecification<I extends Ibdd_in_any, O extends Ibdd_out_any> = {
|
|
@@ -53,6 +60,21 @@ export type WhenSpecification<I extends Ibdd_in_any, O extends Ibdd_out_any> = {
|
|
|
53
60
|
export type ThenSpecification<I extends Ibdd_in_any, O extends Ibdd_out_any> = {
|
|
54
61
|
[K in keyof O["thens"]]: (...xtrasD: O["thens"][K]) => BaseThen<I>;
|
|
55
62
|
};
|
|
63
|
+
export type DescribeSpecification<I extends Ibdd_in_any, O extends Ibdd_out_any> = {
|
|
64
|
+
[K in keyof O["describes"]]: (features: string[], its: BaseIt<I>[], ...xtras: O["describes"][K]) => BaseDescribe<I>;
|
|
65
|
+
};
|
|
66
|
+
export type ItSpecification<I extends Ibdd_in_any, O extends Ibdd_out_any> = {
|
|
67
|
+
[K in keyof O["its"]]: (...xtras: O["its"][K]) => BaseIt<I>;
|
|
68
|
+
};
|
|
69
|
+
export type ConfirmSpecification<I extends Ibdd_in_any, O extends Ibdd_out_any> = {
|
|
70
|
+
[K in keyof O["confirms"]]: (input: O["confirms"][K]) => (tableRows: [v: BaseValue, s: BaseShould][], features: string[]) => BaseConfirm<I>;
|
|
71
|
+
};
|
|
72
|
+
export type ValueSpecification<I extends Ibdd_in_any, O extends Ibdd_out_any> = {
|
|
73
|
+
[K in keyof O["values"]]: () => BaseValue<I>;
|
|
74
|
+
};
|
|
75
|
+
export type ShouldSpecification<I extends Ibdd_in_any, O extends Ibdd_out_any> = {
|
|
76
|
+
[K in keyof O["shoulds"]]: (...xtras: O["shoulds"][K]) => BaseShould<I>;
|
|
77
|
+
};
|
|
56
78
|
export type TestSuiteImplementation<O extends Ibdd_out_any> = {
|
|
57
79
|
[K in keyof O["suites"]]: string;
|
|
58
80
|
};
|
|
@@ -65,11 +87,34 @@ export type TestWhenImplementation<I extends Ibdd_in_any, O extends Ibdd_out_any
|
|
|
65
87
|
export type TestThenImplementation<I extends Ibdd_in_any, O extends Ibdd_out_any> = {
|
|
66
88
|
[K in keyof O["thens"]]: (...It: O["thens"][K]) => (ssel: I["iselection"]) => I["then"];
|
|
67
89
|
};
|
|
90
|
+
export type TestDescribeImplementation<I extends Ibdd_in_any, O extends Ibdd_out_any> = {
|
|
91
|
+
[K in keyof O["describes"]]: (...Id: O["describes"][K]) => I["given"];
|
|
92
|
+
};
|
|
93
|
+
export type TestItImplementation<I extends Ibdd_in_any, O extends Ibdd_out_any> = {
|
|
94
|
+
[K in keyof O["its"]]: (...Ii: O["its"][K]) => (sel: I["iselection"]) => I["then"];
|
|
95
|
+
};
|
|
96
|
+
export type TestValueImplementation<I extends Ibdd_in_any, O extends Ibdd_out_any> = {
|
|
97
|
+
[K in keyof O["values"]]: (...Iv: O["values"][K]) => I["given"];
|
|
98
|
+
};
|
|
99
|
+
export type TestShouldImplementation<I extends Ibdd_in_any, O extends Ibdd_out_any> = {
|
|
100
|
+
[K in keyof O["shoulds"]]: (...Is: O["shoulds"][K]) => (sel: I["iselection"]) => I["then"];
|
|
101
|
+
};
|
|
102
|
+
export type TestExpectedImplementation<I extends Ibdd_in_any, O extends Ibdd_out_any> = {
|
|
103
|
+
[K in keyof O["expecteds"]]: (...Ie: O["expecteds"][K]) => (sel: I["iselection"]) => Promise<I["then"]>;
|
|
104
|
+
};
|
|
105
|
+
export type TestConfirmImplementation<I extends Ibdd_in_any, O extends Ibdd_out_any> = {
|
|
106
|
+
[K in keyof O["confirms"]]: (...Ic: O["confirms"][K]) => I["given"];
|
|
107
|
+
};
|
|
68
108
|
export type Modify<T, R> = Omit<T, keyof R> & R;
|
|
69
109
|
export type TestSuiteShape = Record<string, any>;
|
|
70
110
|
export type TestGivenShape = Record<string, any>;
|
|
71
111
|
export type TestWhenShape = Record<string, any>;
|
|
72
112
|
export type TestThenShape = Record<string, any>;
|
|
113
|
+
export type TestDescribeShape = Record<string, any>;
|
|
114
|
+
export type TestItShape = Record<string, any>;
|
|
115
|
+
export type TestConfirmShape = Record<string, any>;
|
|
116
|
+
export type TestValueShape = Record<string, any>;
|
|
117
|
+
export type TestShouldShape = Record<string, any>;
|
|
73
118
|
export type IPluginFactory = (register?: (entrypoint: string, sources: string[]) => any, entrypoints?: string[]) => Plugin;
|
|
74
119
|
export type IRunTime = `node` | `web` | `golang` | `python` | `ruby` | `java` | `rust`;
|
|
75
120
|
export type ITestTypes = [string, IRunTime, {
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { TestTypeParams_any, IUniversalTestAdapter, ITestAdapter } from "./CoreTypes";
|
|
2
|
+
export declare const BaseAdapter: <T extends TestTypeParams_any>() => IUniversalTestAdapter<T>;
|
|
3
|
+
export declare const DefaultAdapter: <T extends TestTypeParams_any>(p: Partial<ITestAdapter<T>>) => IUniversalTestAdapter<T>;
|
|
@@ -5,7 +5,7 @@ import type { ITestResourceConfiguration } from "./types.js";
|
|
|
5
5
|
* BaseExpected extends BaseCheck for TDT pattern.
|
|
6
6
|
* Validates each row in table-driven testing.
|
|
7
7
|
*/
|
|
8
|
-
export declare class BaseExpected<I extends TestTypeParams_any> extends BaseCheck<I> {
|
|
8
|
+
export declare abstract class BaseExpected<I extends TestTypeParams_any> extends BaseCheck<I> {
|
|
9
9
|
/**
|
|
10
10
|
* Abstract method to be implemented by concrete Expected classes.
|
|
11
11
|
* Validates each row in table-driven testing (TDT pattern).
|
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { BaseWhen } from "./BaseWhen";
|
|
4
|
-
import type { Ibdd_in_any, Ibdd_out_any, ITestSpecification, ITestImplementation, ITestAdapter } from "./CoreTypes.js";
|
|
5
|
-
import type { ITestJob, ITTestResourceRequest, ITestResourceConfiguration } from "./types.js";
|
|
6
|
-
type IExtenstions = Record<string, unknown>;
|
|
1
|
+
import { Ibdd_in_any, Ibdd_out_any, ITestSpecification, ITestImplementation, ITestAdapter } from "./CoreTypes";
|
|
2
|
+
import { ITestJob, ITTestResourceRequest, ITestResourceConfiguration } from "./types";
|
|
7
3
|
export default abstract class BaseTiposkripto<I extends Ibdd_in_any = Ibdd_in_any, O extends Ibdd_out_any = Ibdd_out_any, M = unknown> {
|
|
8
4
|
totalTests: number;
|
|
9
5
|
artifacts: Promise<unknown>[];
|
|
10
|
-
assertThis: (t: I["then"]) => any;
|
|
11
6
|
givenOverrides: Record<string, any>;
|
|
12
7
|
specs: any;
|
|
13
8
|
suitesOverrides: Record<string, any>;
|
|
@@ -17,39 +12,48 @@ export default abstract class BaseTiposkripto<I extends Ibdd_in_any = Ibdd_in_an
|
|
|
17
12
|
thenOverrides: Record<string, any>;
|
|
18
13
|
whenOverrides: Record<string, any>;
|
|
19
14
|
testResourceConfiguration: ITestResourceConfiguration;
|
|
15
|
+
describeOverrides: Record<string, any>;
|
|
16
|
+
itOverrides: Record<string, any>;
|
|
17
|
+
confirmOverrides: Record<string, any>;
|
|
18
|
+
valuesOverrides: Record<string, any>;
|
|
19
|
+
shouldsOverrides: Record<string, any>;
|
|
20
|
+
expectedsOverrides: Record<string, any>;
|
|
20
21
|
abstract writeFileSync(filename: string, payload: string): void;
|
|
21
22
|
createArtifactory(context?: {
|
|
22
23
|
givenKey?: string;
|
|
23
24
|
whenIndex?: number;
|
|
24
25
|
thenIndex?: number;
|
|
25
26
|
suiteIndex?: number;
|
|
27
|
+
stepIndex?: number;
|
|
28
|
+
stepType?: string;
|
|
26
29
|
}): {
|
|
27
30
|
writeFileSync: (filename: string, payload: string) => void;
|
|
28
31
|
};
|
|
29
32
|
constructor(webOrNode: "web" | "node", input: I["iinput"], testSpecification: ITestSpecification<I, O>, testImplementation: ITestImplementation<I, O, M> & {
|
|
30
|
-
suites: Record<string, object>;
|
|
31
33
|
givens?: Record<string, any>;
|
|
32
34
|
whens?: Record<string, any>;
|
|
33
35
|
thens?: Record<string, any>;
|
|
34
|
-
values?: Record<string, any>;
|
|
35
|
-
shoulds?: Record<string, any>;
|
|
36
|
-
expecteds?: Record<string, any>;
|
|
37
36
|
describes?: Record<string, any>;
|
|
38
37
|
its?: Record<string, any>;
|
|
39
|
-
|
|
38
|
+
confirms?: Record<string, any>;
|
|
39
|
+
values?: Record<string, any>;
|
|
40
|
+
shoulds?: Record<string, any>;
|
|
41
|
+
}, testResourceRequirement: ITTestResourceRequest | undefined, testAdapter: Partial<ITestAdapter<I>> | undefined, testResourceConfiguration: ITestResourceConfiguration);
|
|
40
42
|
receiveTestResourceConfig(testResourceConfig: ITestResourceConfiguration): Promise<any>;
|
|
41
43
|
Specs(): any;
|
|
42
|
-
Suites():
|
|
43
|
-
Given(): Record<
|
|
44
|
-
When(): Record<
|
|
45
|
-
Then(): Record<
|
|
44
|
+
Suites(): {};
|
|
45
|
+
Given(): Record<string, any>;
|
|
46
|
+
When(): Record<string, any>;
|
|
47
|
+
Then(): Record<string, any>;
|
|
46
48
|
Describe(): Record<string, any>;
|
|
47
49
|
It(): Record<string, any>;
|
|
48
50
|
Confirm(): Record<string, any>;
|
|
49
51
|
Value(): Record<string, any>;
|
|
50
52
|
Should(): Record<string, any>;
|
|
51
53
|
Expect(): Record<string, any>;
|
|
54
|
+
Expected(): Record<string, any>;
|
|
52
55
|
getTestJobs(): ITestJob[];
|
|
53
|
-
private
|
|
56
|
+
private createTestJobForStep;
|
|
57
|
+
private createErrorTestJob;
|
|
58
|
+
private calculateTotalTestsDirectly;
|
|
54
59
|
}
|
|
55
|
-
export {};
|
|
@@ -1,30 +1,19 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export type IArtifactory = {};
|
|
6
|
-
export type SuiteSpecification<I extends Ibdd_in_any, O extends Ibdd_out_any> = {
|
|
7
|
-
[K in keyof O["suites"]]: (name: string, givens: IGivens<I>) => BaseSuite<I, O>;
|
|
1
|
+
import type { ConfirmSpecification, DescribeSpecification, GivenSpecification, ItSpecification, Modify, ShouldSpecification, TestConfirmImplementation, TestConfirmShape, TestDescribeImplementation, TestDescribeShape, TestExpectedImplementation, TestGivenImplementation, TestGivenShape, TestItImplementation, TestItShape, TestShouldImplementation, TestShouldShape, TestSuiteImplementation, TestSuiteShape, TestThenImplementation, TestThenShape, TestValueImplementation, TestValueShape, TestWhenImplementation, TestWhenShape, ThenSpecification, ValueSpecification, WhenSpecification } from "./../../../Types";
|
|
2
|
+
import { ITestResourceConfiguration } from "./types";
|
|
3
|
+
export type IArtifactory = {
|
|
4
|
+
writeFileSync: (a: string, b: string) => any;
|
|
8
5
|
};
|
|
9
6
|
export type IUniversalTestAdapter<I extends TestTypeParams_any> = {
|
|
10
7
|
prepareAll: (input: I["iinput"], testResource: ITestResourceConfiguration, artifactory?: IArtifactory) => Promise<I["isubject"]>;
|
|
11
|
-
prepareEach: (subject: I["isubject"], initializer: (c?: any) => I["
|
|
12
|
-
execute: (store: I["istore"], actionCB: I["
|
|
13
|
-
verify: (store: I["istore"], checkCB: I["
|
|
8
|
+
prepareEach: (subject: I["isubject"], initializer: (c?: any) => I["check"], testResource: ITestResourceConfiguration, initialValues: any, artifactory?: IArtifactory) => Promise<I["istore"]>;
|
|
9
|
+
execute: (store: I["istore"], actionCB: I["check"], testResource: ITestResourceConfiguration, artifactory?: IArtifactory) => Promise<I["istore"]>;
|
|
10
|
+
verify: (store: I["istore"], checkCB: I["check"], testResource: ITestResourceConfiguration, artifactory?: IArtifactory) => Promise<I["iselection"]>;
|
|
14
11
|
cleanupEach: (store: I["istore"], key: string, artifactory?: IArtifactory) => Promise<unknown>;
|
|
15
12
|
cleanupAll: (store: I["istore"], artifactory: IArtifactory) => any;
|
|
16
|
-
assert: (x: I["
|
|
13
|
+
assert: (x: I["check"]) => any;
|
|
17
14
|
};
|
|
18
|
-
export type ITestAdapter<I extends TestTypeParams_any> = IUniversalTestAdapter<I
|
|
19
|
-
|
|
20
|
-
beforeEach?: (subject: I["isubject"], initializer: (c?: any) => I["given"], testResource: ITestResourceConfiguration, initialValues: any, artifactory?: IArtifactory) => Promise<I["istore"]>;
|
|
21
|
-
afterEach?: (store: I["istore"], key: string, artifactory?: IArtifactory) => Promise<unknown>;
|
|
22
|
-
afterAll?: (store: I["istore"], artifactory: IArtifactory) => any;
|
|
23
|
-
andWhen?: (store: I["istore"], actionCB: I["when"], testResource: ITestResourceConfiguration, artifactory?: IArtifactory) => Promise<I["istore"]>;
|
|
24
|
-
butThen?: (store: I["istore"], checkCB: I["then"], testResource: ITestResourceConfiguration, artifactory?: IArtifactory) => Promise<I["iselection"]>;
|
|
25
|
-
assertThis?: (x: I["then"]) => any;
|
|
26
|
-
};
|
|
27
|
-
export type ITestSpecification<I extends Ibdd_in_any, O extends Ibdd_out_any> = (Suite: SuiteSpecification<I, O>, Given: GivenSpecification<I, O>, When: WhenSpecification<I, O>, Then: ThenSpecification<I, O>, Describe: DescribewSpecification<I, O>, It: ItSpecification<I, O>, Confirm: ValueSpecification<I, O>, Value: ValueSpecification<I, O>, Should: ShouldSpecification<I, O>, Expected: ExpectSpecification<I, O>) => BaseSuite<I, O>[];
|
|
15
|
+
export type ITestAdapter<I extends TestTypeParams_any> = IUniversalTestAdapter<I>;
|
|
16
|
+
export type ITestSpecification<I extends Ibdd_in_any, O extends Ibdd_out_any> = (Given: GivenSpecification<I, O>, When: WhenSpecification<I, O>, Then: ThenSpecification<I, O>, Describe: DescribeSpecification<I, O>, It: ItSpecification<I, O>, Confirm: ConfirmSpecification<I, O>, Value: ValueSpecification<I, O>, Should: ShouldSpecification<I, O>) => any[];
|
|
28
17
|
export type ITestImplementation<I extends Ibdd_in_any, O extends Ibdd_out_any, modifier = {
|
|
29
18
|
whens: TestWhenImplementation<I, O>;
|
|
30
19
|
}> = Modify<{
|
|
@@ -32,15 +21,25 @@ export type ITestImplementation<I extends Ibdd_in_any, O extends Ibdd_out_any, m
|
|
|
32
21
|
givens: TestGivenImplementation<I, O>;
|
|
33
22
|
whens: TestWhenImplementation<I, O>;
|
|
34
23
|
thens: TestThenImplementation<I, O>;
|
|
24
|
+
confirms: TestConfirmImplementation<I, O>;
|
|
25
|
+
values: TestValueImplementation<I, O>;
|
|
26
|
+
shoulds: TestShouldImplementation<I, O>;
|
|
27
|
+
expecteds: TestExpectedImplementation<I, O>;
|
|
28
|
+
describes: TestDescribeImplementation<I, O>;
|
|
29
|
+
its: TestItImplementation<I, O>;
|
|
35
30
|
}, modifier>;
|
|
36
|
-
export type TestSpecShape<
|
|
37
|
-
suites: ISuites;
|
|
31
|
+
export type TestSpecShape<ISetups extends TestGivenShape = TestGivenShape, IActions extends TestWhenShape = TestWhenShape, IChecks extends TestThenShape = TestThenShape, IDescribes extends TestGivenShape = TestGivenShape, IIts extends TestWhenShape = TestWhenShape, IConfirms extends TestGivenShape = TestGivenShape, IValues extends TestGivenShape = TestGivenShape, IShoulds extends TestWhenShape = TestWhenShape> = {
|
|
38
32
|
givens: ISetups;
|
|
39
33
|
whens: IActions;
|
|
40
34
|
thens: IChecks;
|
|
35
|
+
describes: IDescribes;
|
|
36
|
+
its: IIts;
|
|
37
|
+
confirms: IConfirms;
|
|
38
|
+
values: IValues;
|
|
39
|
+
should?: IShoulds;
|
|
41
40
|
};
|
|
42
41
|
export type TestSpecShape_any = TestSpecShape<TestSuiteShape, TestGivenShape, TestWhenShape, TestThenShape>;
|
|
43
|
-
export type Ibdd_out<
|
|
42
|
+
export type Ibdd_out<IGivens extends TestGivenShape, IWhens extends TestWhenShape, IThens extends TestThenShape, IDescribes extends TestDescribeShape, IIts extends TestItShape, IConfirms extends TestConfirmShape, IValues extends TestValueShape, IShoulds extends TestShouldShape> = TestSpecShape<IGivens, IWhens, IThens, IDescribes, IIts, IConfirms, IValues, IShoulds>;
|
|
44
43
|
export type Ibdd_out_any = TestSpecShape_any;
|
|
45
44
|
export type TestTypeParams<IInput, // Type of initial test input
|
|
46
45
|
ISubject, // Type of object being tested
|
|
@@ -58,12 +57,12 @@ ICheck> = {
|
|
|
58
57
|
/** Selected portion of state for assertions */
|
|
59
58
|
iselection: ISelection;
|
|
60
59
|
/** Function type for Setup steps (Given/Arrange/Map) */
|
|
61
|
-
|
|
60
|
+
setup: ISetup;
|
|
62
61
|
/** Function type for Action steps (When/Act/Feed) */
|
|
63
|
-
|
|
62
|
+
action: IAction;
|
|
64
63
|
/** Function type for Check steps (Then/Assert/Validate) */
|
|
65
|
-
|
|
64
|
+
check: ICheck;
|
|
66
65
|
};
|
|
67
66
|
export type TestTypeParams_any = TestTypeParams<unknown, unknown, unknown, unknown, unknown, unknown, unknown>;
|
|
68
|
-
export type Ibdd_in<IInput, ISubject, IStore, ISelection,
|
|
67
|
+
export type Ibdd_in<IInput, ISubject, IStore, ISelection, ISetup, IAction, ICheck> = TestTypeParams<IInput, ISubject, IStore, ISelection, ISetup, IAction, ICheck>;
|
|
69
68
|
export type Ibdd_in_any = TestTypeParams_any;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import BaseTiposkripto from "./BaseTiposkripto.js";
|
|
2
|
+
import { ITTestResourceRequest } from "./types.js";
|
|
3
|
+
import { TestTypeParams_any, TestSpecShape_any, ITestSpecification, ITestImplementation, ITestAdapter } from "./CoreTypes.js";
|
|
4
4
|
export declare class NodeTiposkripto<I extends TestTypeParams_any, O extends TestSpecShape_any, M> extends BaseTiposkripto<I, O, M> {
|
|
5
|
-
constructor(input: I["iinput"], testSpecification: ITestSpecification<I, O>, testImplementation: ITestImplementation<I, O, M>,
|
|
5
|
+
constructor(input: I["iinput"], testSpecification: ITestSpecification<I, O>, testImplementation: ITestImplementation<I, O, M>, testAdapter: Partial<ITestAdapter<I>>, testResourceRequirement?: ITTestResourceRequest);
|
|
6
6
|
writeFileSync(filename: string, payload: string): void;
|
|
7
7
|
}
|
|
8
8
|
declare const tiposkripto: <I extends TestTypeParams_any, O extends TestSpecShape_any, M>(input: I["iinput"], testSpecification: ITestSpecification<I, O>, testImplementation: ITestImplementation<I, O, M>, testAdapter: Partial<ITestAdapter<I>>, testResourceRequirement?: ITTestResourceRequest) => Promise<BaseTiposkripto<I, O, M>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { TestTypeParams_any, TestSpecShape_any, ITestAdapter, ITestImplementation, ITestSpecification } from "./CoreTypes.js";
|
|
2
1
|
import BaseTiposkripto from "./BaseTiposkripto";
|
|
3
|
-
import
|
|
2
|
+
import { TestTypeParams_any, TestSpecShape_any, ITestSpecification, ITestImplementation, ITestAdapter } from "./CoreTypes";
|
|
3
|
+
import { ITTestResourceRequest } from "./types";
|
|
4
4
|
declare global {
|
|
5
5
|
interface Window {
|
|
6
6
|
testResourceConfig?: any;
|
|
@@ -15,10 +15,16 @@ export declare class WebTiposkripto<I extends TestTypeParams_any, O extends Test
|
|
|
15
15
|
openScreencast(filename: string): Promise<void>;
|
|
16
16
|
closeScreencast(filename: string): Promise<void>;
|
|
17
17
|
createArtifactory(context?: {
|
|
18
|
+
suiteIndex?: number;
|
|
18
19
|
givenKey?: string;
|
|
19
20
|
whenIndex?: number;
|
|
20
21
|
thenIndex?: number;
|
|
21
|
-
|
|
22
|
+
describeIndex?: number;
|
|
23
|
+
itIndex?: number;
|
|
24
|
+
confirmKey?: string;
|
|
25
|
+
valueKey?: string;
|
|
26
|
+
shouldIndex?: number;
|
|
27
|
+
expectKey?: number;
|
|
22
28
|
}): {
|
|
23
29
|
screenshot: (filename: string, payload?: string) => void;
|
|
24
30
|
openScreencast: (filename: string) => Promise<void>;
|
|
@@ -1,26 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
export { BaseValue } from "./BaseValue.js";
|
|
8
|
-
export { BaseShould } from "./BaseShould.js";
|
|
9
|
-
export { BaseExpected } from "./BaseExpected.js";
|
|
10
|
-
export { BaseDescribe } from "./BaseDescribe.js";
|
|
11
|
-
export { BaseIt } from "./BaseIt.js";
|
|
12
|
-
export { BaseSetup } from "./BaseSetup.js";
|
|
13
|
-
export { BaseAction } from "./BaseAction.js";
|
|
14
|
-
export { BaseCheck } from "./BaseCheck.js";
|
|
1
|
+
import { Ibdd_in_any, Ibdd_out_any } from "./CoreTypes.js";
|
|
2
|
+
export { BaseValue } from "./verbs/tdt/BaseValue.js";
|
|
3
|
+
export { BaseShould } from "./verbs/tdt/BaseShould";
|
|
4
|
+
export { BaseExpected } from "./verbs/tdt/BaseExpected.js";
|
|
5
|
+
export { BaseDescribe } from "./verbs/aaa/BaseDescribe.js";
|
|
6
|
+
export { BaseIt } from "./verbs/aaa/BaseIt.js";
|
|
15
7
|
export declare function createDescribeItSpecification<I extends Ibdd_in_any, O extends Ibdd_out_any>(): {
|
|
16
8
|
Suite: {
|
|
17
9
|
Default: (Suite: any, Describe: any, It: any) => (name: string, descriptions: Record<string, any>) => any;
|
|
18
10
|
};
|
|
19
11
|
Describe: {
|
|
20
|
-
Default: (features: string[], its: any[], describeCB: I["
|
|
12
|
+
Default: (features: string[], its: any[], describeCB: I["setup"], initialValues: any) => (Describe: any) => any;
|
|
21
13
|
};
|
|
22
14
|
It: {
|
|
23
|
-
Default: (name: string, itCB: (x: I["iselection"]) => I["
|
|
15
|
+
Default: (name: string, itCB: (x: I["iselection"]) => I["check"]) => (It: any) => any;
|
|
24
16
|
};
|
|
25
17
|
};
|
|
26
18
|
export declare function createTDTSpecification<I extends Ibdd_in_any, O extends Ibdd_out_any>(): {
|
|
@@ -28,13 +20,13 @@ export declare function createTDTSpecification<I extends Ibdd_in_any, O extends
|
|
|
28
20
|
Default: (Suite: any, Value: any, Should: any, Expected: any) => (name: string, confirms: Record<string, any>) => any;
|
|
29
21
|
};
|
|
30
22
|
Value: {
|
|
31
|
-
Default: (features: string[], tableRows: any[][], confirmCB: I["
|
|
23
|
+
Default: (features: string[], tableRows: any[][], confirmCB: I["setup"], initialValues: any) => (Value: any) => any;
|
|
32
24
|
};
|
|
33
25
|
Should: {
|
|
34
|
-
Default: (name: string, shouldCB: (x: I["iselection"]) => I["
|
|
26
|
+
Default: (name: string, shouldCB: (x: I["iselection"]) => I["check"]) => (Should: any) => any;
|
|
35
27
|
};
|
|
36
28
|
Expected: {
|
|
37
|
-
Default: (name: string, expectedCB: (val: I["iselection"]) => Promise<I["
|
|
29
|
+
Default: (name: string, expectedCB: (val: I["iselection"]) => Promise<I["check"]>) => (Expected: any) => any;
|
|
38
30
|
};
|
|
39
31
|
};
|
|
40
32
|
export declare function DescribeIt<I extends Ibdd_in_any, O extends Ibdd_out_any>(): {
|
|
@@ -45,17 +37,17 @@ export declare function DescribeIt<I extends Ibdd_in_any, O extends Ibdd_out_any
|
|
|
45
37
|
};
|
|
46
38
|
};
|
|
47
39
|
Describe: {
|
|
48
|
-
Default: (features: string[], its: any[], describeCB: I["
|
|
40
|
+
Default: (features: string[], its: any[], describeCB: I["setup"], initialValues: any) => {
|
|
49
41
|
features: string[];
|
|
50
42
|
its: any[];
|
|
51
|
-
describeCB: I["
|
|
43
|
+
describeCB: I["setup"];
|
|
52
44
|
initialValues: any;
|
|
53
45
|
};
|
|
54
46
|
};
|
|
55
47
|
It: {
|
|
56
|
-
Default: (name: string, itCB: (x: I["iselection"]) => I["
|
|
48
|
+
Default: (name: string, itCB: (x: I["iselection"]) => I["check"]) => {
|
|
57
49
|
name: string;
|
|
58
|
-
itCB: (x: I["iselection"]) => I["
|
|
50
|
+
itCB: (x: I["iselection"]) => I["check"];
|
|
59
51
|
};
|
|
60
52
|
};
|
|
61
53
|
};
|
|
@@ -67,23 +59,23 @@ export declare function Confirm<I extends Ibdd_in_any, O extends Ibdd_out_any>()
|
|
|
67
59
|
};
|
|
68
60
|
};
|
|
69
61
|
Value: {
|
|
70
|
-
Default: (features: string[], tableRows: any[][], confirmCB: I["
|
|
62
|
+
Default: (features: string[], tableRows: any[][], confirmCB: I["setup"], initialValues: any) => {
|
|
71
63
|
features: string[];
|
|
72
64
|
tableRows: any[][];
|
|
73
|
-
confirmCB: I["
|
|
65
|
+
confirmCB: I["setup"];
|
|
74
66
|
initialValues: any;
|
|
75
67
|
};
|
|
76
68
|
};
|
|
77
69
|
Should: {
|
|
78
|
-
Default: (name: string, shouldCB: (x: I["iselection"]) => I["
|
|
70
|
+
Default: (name: string, shouldCB: (x: I["iselection"]) => I["check"]) => {
|
|
79
71
|
name: string;
|
|
80
|
-
shouldCB: (x: I["iselection"]) => I["
|
|
72
|
+
shouldCB: (x: I["iselection"]) => I["check"];
|
|
81
73
|
};
|
|
82
74
|
};
|
|
83
75
|
Expected: {
|
|
84
|
-
Default: (name: string, expectedCB: (val: I["iselection"]) => Promise<I["
|
|
76
|
+
Default: (name: string, expectedCB: (val: I["iselection"]) => Promise<I["check"]>) => {
|
|
85
77
|
name: string;
|
|
86
|
-
expectedCB: (val: I["iselection"]) => Promise<I["
|
|
78
|
+
expectedCB: (val: I["iselection"]) => Promise<I["check"]>;
|
|
87
79
|
};
|
|
88
80
|
};
|
|
89
81
|
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { Ibdd_in_any, Ibdd_out_any } from "./CoreTypes";
|
|
2
|
+
import { BaseDescribe } from "./verbs/aaa/BaseDescribe";
|
|
3
|
+
import { BaseSuite } from "./verbs/BaseSuite";
|
|
4
|
+
import { BaseGiven } from "./verbs/bdd/BaseGiven";
|
|
5
|
+
import { BaseThen } from "./verbs/bdd/BaseThen";
|
|
6
|
+
import { BaseWhen } from "./verbs/bdd/BaseWhen";
|
|
7
|
+
import { BaseConfirm } from "./verbs/tdt/BaseConfirm";
|
|
8
|
+
export type IGivenKlasser<I extends Ibdd_in_any> = (name: string, features: string[], whens: BaseWhen<I>[], thens: BaseThen<I>[], givenCB: I["setup"]) => BaseGiven<I>;
|
|
8
9
|
export type IWhenKlasser<I extends Ibdd_in_any> = (s: I["istore"], o: any) => BaseWhen<I>;
|
|
9
10
|
export type IThenKlasser<I extends Ibdd_in_any> = (s: I["iselection"], o: any) => BaseThen<I>;
|
|
10
11
|
export type ITestResourceConfiguration = {
|
|
@@ -21,24 +22,13 @@ export type ITTestResourceRequirement = {
|
|
|
21
22
|
ports: number;
|
|
22
23
|
fs: string;
|
|
23
24
|
};
|
|
24
|
-
export type ISetups<I extends TestTypeParams_any> = Record<string, import("./BaseSetup").BaseSetup<I>>;
|
|
25
|
-
export type IActions<I extends TestTypeParams_any> = Record<string, import("./BaseAction").BaseAction<I>>;
|
|
26
|
-
export type IChecks<I extends TestTypeParams_any> = Record<string, import("./BaseCheck").BaseCheck<I>>;
|
|
27
|
-
export type IValues<I extends TestTypeParams_any> = Record<string, import("./BaseValue").BaseValue<I>>;
|
|
28
|
-
export type IShoulds<I extends TestTypeParams_any> = Record<string, import("./BaseShould").BaseShould<I>>;
|
|
29
|
-
export type IExpecteds<I extends TestTypeParams_any> = Record<string, import("./BaseExpected").BaseExpected<I>>;
|
|
30
|
-
export type IDescribes<I extends TestTypeParams_any> = Record<string, import("./BaseDescribe").BaseDescribe<I>>;
|
|
31
|
-
export type IIts<I extends TestTypeParams_any> = Record<string, import("./BaseIt").BaseIt<I>>;
|
|
32
|
-
export type IGivens<I extends TestTypeParams_any> = Record<string, import("./BaseGiven").BaseGiven<I>>;
|
|
33
|
-
export type IWhens<I extends TestTypeParams_any> = Record<string, import("./BaseWhen").BaseWhen<I>>;
|
|
34
|
-
export type IThens<I extends TestTypeParams_any> = Record<string, import("./BaseThen").BaseThen<I>>;
|
|
35
25
|
export type ITTestResourceRequest = {
|
|
36
26
|
ports: number;
|
|
37
27
|
};
|
|
38
28
|
type ITest = {
|
|
39
29
|
toObj(): object;
|
|
40
30
|
name: string;
|
|
41
|
-
|
|
31
|
+
steps: (BaseGiven<Ibdd_in_any> | BaseDescribe<Ibdd_in_any> | BaseConfirm<Ibdd_in_any>)[];
|
|
42
32
|
testResourceConfiguration: ITestResourceConfiguration;
|
|
43
33
|
};
|
|
44
34
|
export type ITestJob = {
|
|
@@ -53,19 +43,21 @@ export type ITestResults = Promise<{
|
|
|
53
43
|
}>[];
|
|
54
44
|
export declare const defaultTestResourceRequirement: ITTestResourceRequest;
|
|
55
45
|
export type ITestArtifactory = (key: string, value: unknown) => unknown;
|
|
56
|
-
export type IRunnables = {
|
|
57
|
-
golangEntryPoints: Record<string, string>;
|
|
58
|
-
nodeEntryPoints: Record<string, string>;
|
|
59
|
-
pythonEntryPoints: Record<string, string>;
|
|
60
|
-
webEntryPoints: Record<string, string>;
|
|
61
|
-
};
|
|
62
46
|
export type IFinalResults = {
|
|
63
47
|
features: string[];
|
|
64
48
|
failed: boolean;
|
|
65
49
|
fails: number;
|
|
66
|
-
artifacts:
|
|
50
|
+
artifacts: any[];
|
|
67
51
|
tests: number;
|
|
68
52
|
runTimeTests: number;
|
|
69
53
|
testJob: object;
|
|
54
|
+
error?: {
|
|
55
|
+
message: string;
|
|
56
|
+
stack?: string;
|
|
57
|
+
name: string;
|
|
58
|
+
};
|
|
59
|
+
stepName?: string;
|
|
60
|
+
stepType?: string;
|
|
61
|
+
[key: string]: any;
|
|
70
62
|
};
|
|
71
63
|
export {};
|
|
File without changes
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { TestTypeParams_any } from "../../CoreTypes.js";
|
|
2
|
+
import { BaseIt } from "./BaseIt.js";
|
|
3
|
+
import { ITestResourceConfiguration, ITestArtifactory } from "../../types.js";
|
|
4
|
+
/**
|
|
5
|
+
* BaseDescribe for AAA (Describe-It) pattern.
|
|
6
|
+
* Handles the Arrange/Setup phase.
|
|
7
|
+
*/
|
|
8
|
+
export declare class BaseDescribe<I extends TestTypeParams_any> {
|
|
9
|
+
features: string[];
|
|
10
|
+
its: BaseIt<I>[];
|
|
11
|
+
describeCB: I["given"];
|
|
12
|
+
initialValues: any;
|
|
13
|
+
error: Error | null;
|
|
14
|
+
store: I["istore"];
|
|
15
|
+
key: string;
|
|
16
|
+
failed: boolean;
|
|
17
|
+
artifacts: string[];
|
|
18
|
+
fails: number;
|
|
19
|
+
status: boolean | undefined;
|
|
20
|
+
constructor(features: string[], its: BaseIt<I>[], describeCB: I["given"], initialValues: any);
|
|
21
|
+
addArtifact(path: string): void;
|
|
22
|
+
describe(subject: I["isubject"], key: string, testResourceConfiguration: ITestResourceConfiguration, tester: (t: Awaited<I["then"]> | undefined) => boolean, artifactory?: ITestArtifactory, suiteNdx?: number): Promise<I["istore"]>;
|
|
23
|
+
toObj(): {
|
|
24
|
+
key: string;
|
|
25
|
+
its: {
|
|
26
|
+
name: string;
|
|
27
|
+
status: boolean | undefined;
|
|
28
|
+
error: string | null;
|
|
29
|
+
artifacts: string[];
|
|
30
|
+
}[];
|
|
31
|
+
error: (string | undefined)[] | null;
|
|
32
|
+
failed: boolean;
|
|
33
|
+
features: string[];
|
|
34
|
+
artifacts: string[];
|
|
35
|
+
status: boolean | undefined;
|
|
36
|
+
fails: number;
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
export type IDescribes<I extends TestTypeParams_any> = Record<string, BaseDescribe<I>>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { TestTypeParams_any } from "../../CoreTypes.js";
|
|
2
|
+
/**
|
|
3
|
+
* BaseIt for AAA (Describe-It) pattern.
|
|
4
|
+
* It combines both Action and Check phases (Act + Assert).
|
|
5
|
+
*/
|
|
6
|
+
export declare class BaseIt<I extends TestTypeParams_any> {
|
|
7
|
+
name: string;
|
|
8
|
+
itCB: (xyz: I["iselection"]) => I["check"];
|
|
9
|
+
error: Error | null;
|
|
10
|
+
artifacts: string[];
|
|
11
|
+
status: boolean | undefined;
|
|
12
|
+
constructor(name: string, itCB: (xyz: I["iselection"]) => I["check"]);
|
|
13
|
+
addArtifact(path: string): void;
|
|
14
|
+
test(store: I["istore"], testResourceConfiguration: any, artifactory?: any): Promise<I["check"]>;
|
|
15
|
+
toObj(): {
|
|
16
|
+
name: string;
|
|
17
|
+
status: boolean | undefined;
|
|
18
|
+
error: string | null;
|
|
19
|
+
artifacts: string[];
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export type IIts<I extends TestTypeParams_any> = Record<string, BaseIt<I>>;
|