testeranto 0.113.1 → 0.121.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -2
- package/bundle.js +1 -1
- package/dist/common/Init.js +55 -61
- package/dist/common/PM/base.js +233 -0
- package/dist/common/PM/main.js +217 -434
- package/dist/common/build.js +113 -92
- package/dist/common/defaultConfig.js +2 -2
- package/dist/common/esbuildConfigs/index.js +1 -1
- package/dist/common/esbuildConfigs/inputFilesPlugin.js +7 -3
- package/dist/common/esbuildConfigs/node.js +5 -3
- package/dist/common/esbuildConfigs/web.js +3 -3
- package/dist/common/init-docs.js +2 -46
- package/dist/common/lib/abstractBase.js +60 -54
- package/dist/common/lib/basebuilder.js +7 -8
- package/dist/common/lib/classBuilder.js +8 -5
- package/dist/common/lib/core.js +6 -18
- package/dist/common/lib/index.js +6 -1
- package/dist/common/run.js +10 -2
- package/dist/common/tsconfig.common.tsbuildinfo +1 -1
- package/dist/common/utils.js +9 -21
- package/dist/module/Init.js +55 -61
- package/dist/module/PM/base.js +226 -0
- package/dist/module/PM/main.js +218 -435
- package/dist/module/Project.js +117 -0
- package/dist/module/TestReport.js +13 -4
- package/dist/module/build.js +113 -92
- package/dist/module/defaultConfig.js +2 -2
- package/dist/module/esbuildConfigs/index.js +1 -1
- package/dist/module/esbuildConfigs/inputFilesPlugin.js +7 -3
- package/dist/module/esbuildConfigs/node.js +5 -3
- package/dist/module/esbuildConfigs/web.js +3 -3
- package/dist/module/init-docs.js +2 -13
- package/dist/module/lib/abstractBase.js +60 -54
- package/dist/module/lib/basebuilder.js +7 -8
- package/dist/module/lib/classBuilder.js +8 -5
- package/dist/module/lib/core.js +6 -18
- package/dist/module/lib/index.js +6 -1
- package/dist/module/run.js +10 -2
- package/dist/module/tsconfig.module.tsbuildinfo +1 -1
- package/dist/module/utils.js +8 -17
- package/dist/prebuild/Project.css +11367 -0
- package/dist/prebuild/Project.js +24640 -0
- package/dist/prebuild/ReportClient.js +1 -1
- package/dist/prebuild/TestReport.js +9 -11
- package/dist/prebuild/build.mjs +142 -81
- package/dist/prebuild/init-docs.mjs +28 -83
- package/dist/prebuild/run.mjs +618 -537
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/Init.d.ts +1 -1
- package/dist/types/PM/base.d.ts +38 -0
- package/dist/types/PM/main.d.ts +20 -44
- package/dist/types/esbuildConfigs/inputFilesPlugin.d.ts +1 -1
- package/dist/types/esbuildConfigs/node.d.ts +1 -1
- package/dist/types/esbuildConfigs/web.d.ts +1 -1
- package/dist/types/lib/abstractBase.d.ts +19 -11
- package/dist/types/lib/basebuilder.d.ts +1 -2
- package/dist/types/lib/index.d.ts +3 -3
- package/dist/types/lib/types.d.ts +2 -5
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/dist/types/utils.d.ts +4 -7
- package/package.json +7 -6
- package/src/Init.ts +60 -68
- package/src/PM/base.ts +301 -0
- package/src/PM/main.ts +276 -567
- package/src/Project.tsx +197 -0
- package/src/ReportClient.tsx +1 -1
- package/src/TestReport.tsx +30 -15
- package/src/build.ts +140 -104
- package/src/defaultConfig.ts +2 -2
- package/src/esbuildConfigs/index.ts +1 -1
- package/src/esbuildConfigs/inputFilesPlugin.ts +7 -6
- package/src/esbuildConfigs/node.ts +5 -3
- package/src/esbuildConfigs/web.ts +4 -3
- package/src/init-docs.ts +2 -15
- package/src/lib/abstractBase.ts +113 -93
- package/src/lib/basebuilder.ts +8 -9
- package/src/lib/classBuilder.ts +11 -10
- package/src/lib/core.ts +15 -27
- package/src/lib/index.ts +13 -6
- package/src/lib/types.ts +3 -8
- package/src/run.ts +21 -5
- package/src/utils.ts +27 -39
- package/tsc.log +12 -23
- package/dist/common/puppeteerConfiger.js +0 -24
- package/dist/module/puppeteerConfiger.js +0 -19
- package/dist/types/puppeteerConfiger.d.ts +0 -4
- package/src/puppeteerConfiger.ts +0 -26
|
@@ -11,8 +11,11 @@ class ClassBuilder extends basebuilder_js_1.BaseBuilder {
|
|
|
11
11
|
return a;
|
|
12
12
|
}, {});
|
|
13
13
|
const classyGivens = Object.entries(testImplementation.givens).reduce((a, [key, g]) => {
|
|
14
|
-
a[key] = (features, whens, thens
|
|
15
|
-
|
|
14
|
+
a[key] = (features, whens, thens) => {
|
|
15
|
+
// console.log("givEn", givEn.toString());
|
|
16
|
+
return new givenKlasser.prototype.constructor(key, features, whens, thens, testImplementation.givens[key]
|
|
17
|
+
// givEn
|
|
18
|
+
);
|
|
16
19
|
};
|
|
17
20
|
return a;
|
|
18
21
|
}, {});
|
|
@@ -28,9 +31,9 @@ class ClassBuilder extends basebuilder_js_1.BaseBuilder {
|
|
|
28
31
|
};
|
|
29
32
|
return a;
|
|
30
33
|
}, {});
|
|
31
|
-
const classyChecks = Object.entries(testImplementation.checks).reduce((a, [key,
|
|
32
|
-
a[key] = (
|
|
33
|
-
return new checkKlasser.prototype.constructor(
|
|
34
|
+
const classyChecks = Object.entries(testImplementation.checks).reduce((a, [key, chEck]) => {
|
|
35
|
+
a[key] = (name, features, checker) => {
|
|
36
|
+
return new checkKlasser.prototype.constructor(key, features, chEck, checker);
|
|
34
37
|
};
|
|
35
38
|
return a;
|
|
36
39
|
}, {});
|
package/dist/common/lib/core.js
CHANGED
|
@@ -31,15 +31,10 @@ class Testeranto extends classBuilder_js_1.ClassBuilder {
|
|
|
31
31
|
this.uberCatcher = uberCatcher;
|
|
32
32
|
}
|
|
33
33
|
async givenThat(subject, testResource, artifactory, initializer, initialValues, pm) {
|
|
34
|
-
return fullTestInterface.beforeEach(subject, initializer,
|
|
35
|
-
// artifactory,
|
|
36
|
-
testResource, initialValues, pm);
|
|
34
|
+
return fullTestInterface.beforeEach(subject, initializer, testResource, initialValues, pm);
|
|
37
35
|
}
|
|
38
36
|
afterEach(store, key, artifactory, pm) {
|
|
39
|
-
return new Promise((res) => res(fullTestInterface.afterEach(store, key,
|
|
40
|
-
// (fPath: string, value: unknown) =>
|
|
41
|
-
// artifactory(`after/${fPath}`, value),
|
|
42
|
-
pm)));
|
|
37
|
+
return new Promise((res) => res(fullTestInterface.afterEach(store, key, pm)));
|
|
43
38
|
}
|
|
44
39
|
}, class When extends abstractBase_js_1.BaseWhen {
|
|
45
40
|
async andWhen(store, whenCB, testResource, pm) {
|
|
@@ -95,21 +90,14 @@ class Testeranto extends classBuilder_js_1.ClassBuilder {
|
|
|
95
90
|
}
|
|
96
91
|
}, class Check extends abstractBase_js_1.BaseCheck {
|
|
97
92
|
constructor(name, features, checkCallback, whens, thens, initialValues) {
|
|
98
|
-
super(name, features,
|
|
93
|
+
super(name, features, whens, thens, checkCallback, initialValues);
|
|
99
94
|
this.initialValues = initialValues;
|
|
100
95
|
}
|
|
101
|
-
async checkThat(subject, testResourceConfiguration, artifactory, pm) {
|
|
102
|
-
return fullTestInterface.beforeEach(subject,
|
|
103
|
-
// (fPath: string, value: unknown) =>
|
|
104
|
-
// artifactory(`before/${fPath}`, value),
|
|
105
|
-
testResourceConfiguration, this.initialValues, pm);
|
|
96
|
+
async checkThat(subject, testResourceConfiguration, artifactory, initializer, initialValues, pm) {
|
|
97
|
+
return fullTestInterface.beforeEach(subject, initializer, testResourceConfiguration, initialValues, pm);
|
|
106
98
|
}
|
|
107
99
|
afterEach(store, key, artifactory, pm) {
|
|
108
|
-
return new Promise((res) => res(fullTestInterface.afterEach(store, key,
|
|
109
|
-
// (fPath: string, value: unknown) =>
|
|
110
|
-
// // TODO does not work?
|
|
111
|
-
// artifactory(`afterEach2-${this.name}/${fPath}`, value),
|
|
112
|
-
pm)));
|
|
100
|
+
return new Promise((res) => res(fullTestInterface.afterEach(store, key, pm)));
|
|
113
101
|
}
|
|
114
102
|
}, testResourceRequirement);
|
|
115
103
|
}
|
package/dist/common/lib/index.js
CHANGED
|
@@ -8,7 +8,12 @@ exports.BaseTestInterface = {
|
|
|
8
8
|
},
|
|
9
9
|
afterEach: async (s) => s,
|
|
10
10
|
afterAll: (store) => undefined,
|
|
11
|
-
butThen: async (store, thenCb) =>
|
|
11
|
+
butThen: async (store, thenCb) => {
|
|
12
|
+
try {
|
|
13
|
+
thenCb(store);
|
|
14
|
+
}
|
|
15
|
+
catch (e) { }
|
|
16
|
+
},
|
|
12
17
|
andWhen: (a) => a,
|
|
13
18
|
assertThis: () => null,
|
|
14
19
|
};
|
package/dist/common/run.js
CHANGED
|
@@ -38,6 +38,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
const ansi_colors_1 = __importDefault(require("ansi-colors"));
|
|
40
40
|
const readline_1 = __importDefault(require("readline"));
|
|
41
|
+
const path_1 = __importDefault(require("path"));
|
|
41
42
|
const main_1 = require("./PM/main");
|
|
42
43
|
readline_1.default.emitKeypressEvents(process.stdin);
|
|
43
44
|
if (process.stdin.isTTY)
|
|
@@ -49,10 +50,17 @@ process.stdin.on("keypress", (str, key) => {
|
|
|
49
50
|
process.exit(-1);
|
|
50
51
|
}
|
|
51
52
|
});
|
|
53
|
+
const mode = process.argv[3];
|
|
54
|
+
if (mode !== "once" && mode !== "dev") {
|
|
55
|
+
console.error("the 2nd argument should be 'dev' or 'once' ");
|
|
56
|
+
process.exit(-1);
|
|
57
|
+
}
|
|
52
58
|
Promise.resolve(`${process.cwd() + "/" + process.argv[2]}`).then(s => __importStar(require(s))).then(async (module) => {
|
|
59
|
+
const testName = path_1.default.basename(process.argv[2]).split(".")[0];
|
|
60
|
+
console.log("testeranto is running", testName, mode);
|
|
53
61
|
const rawConfig = module.default;
|
|
54
|
-
const config = Object.assign(Object.assign({}, rawConfig), { buildDir: process.cwd() + "/" +
|
|
55
|
-
const pm = new main_1.PM_Main(config);
|
|
62
|
+
const config = Object.assign(Object.assign({}, rawConfig), { buildDir: process.cwd() + "/" + `testeranto/${testName}.json` });
|
|
63
|
+
const pm = new main_1.PM_Main(config, testName, mode);
|
|
56
64
|
pm.start();
|
|
57
65
|
process.stdin.on("keypress", (str, key) => {
|
|
58
66
|
if (key.name === "q") {
|