testeranto 0.62.0 → 0.73.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +38 -26
- package/dist/cjs-shim.js +2 -2
- package/dist/common/Node.js +14 -51
- package/dist/common/PM/index.js +71 -0
- package/dist/common/PM/main.js +361 -0
- package/dist/common/PM/node.js +176 -0
- package/dist/common/PM/web.js +174 -0
- package/dist/common/Project.js +121 -266
- package/dist/common/Puppeteer.js +109 -0
- package/dist/common/Reporter.js +119 -0
- package/dist/common/Scheduler.js +1 -0
- package/dist/common/SubPackages/puppeteer.js +3 -1
- package/dist/common/SubPackages/react-dom/component/web.js +98 -45
- package/dist/common/SubPackages/react-dom/jsx/web.js +15 -7
- package/dist/common/SubPackages/react-test-renderer/MemoExoticComponent/node.js +1 -1
- package/dist/common/SubPackages/react-test-renderer/component/index.js +0 -1
- package/dist/common/SubPackages/react-test-renderer/fc/web.js +1 -1
- package/dist/common/SubPackages/react-test-renderer/jsx/index.js +1 -3
- package/dist/common/SubPackages/react-test-renderer/jsx/web.js +1 -1
- package/dist/common/SubPackages/react-test-renderer/jsx-promised/index.js +1 -1
- package/dist/common/Types.js +2 -32
- package/dist/common/Web.js +25 -37
- package/dist/common/esbuildConfigs/index.js +5 -5
- package/dist/common/esbuildConfigs/node.js +17 -15
- package/dist/common/esbuildConfigs/report.js +12 -47
- package/dist/common/esbuildConfigs/tests.js +0 -1
- package/dist/common/esbuildConfigs/web.js +17 -12
- package/dist/common/lib/abstractBase.js +190 -35
- package/dist/common/lib/basebuilder.js +56 -29
- package/dist/common/lib/classBuilder.js +8 -5
- package/dist/common/lib/core.js +42 -17
- package/dist/common/lib/index.js +11 -8
- package/dist/common/lib/types.js +2 -0
- package/dist/common/preload.js +14 -28
- package/dist/common/puppeteerConfiger.js +24 -0
- package/dist/common/tsconfig.common.tsbuildinfo +1 -1
- package/dist/module/Node.js +14 -51
- package/dist/module/PM/index.js +67 -0
- package/dist/module/PM/main.js +331 -0
- package/dist/module/PM/node.js +168 -0
- package/dist/module/PM/web.js +167 -0
- package/dist/module/Project.js +122 -267
- package/dist/module/Puppeteer.js +104 -0
- package/dist/module/Reporter.js +114 -0
- package/dist/module/Scheduler.js +1 -0
- package/dist/module/SubPackages/puppeteer.js +3 -1
- package/dist/module/SubPackages/react/jsx/node.js +1 -1
- package/dist/module/SubPackages/react/jsx/web.js +1 -1
- package/dist/module/SubPackages/react-dom/component/node.js +2 -2
- package/dist/module/SubPackages/react-dom/component/web.js +98 -45
- package/dist/module/SubPackages/react-dom/jsx/web.js +17 -9
- package/dist/module/SubPackages/react-test-renderer/MemoExoticComponent/node.js +1 -1
- package/dist/module/SubPackages/react-test-renderer/component/index.js +0 -1
- package/dist/module/SubPackages/react-test-renderer/fc/web.js +1 -1
- package/dist/module/SubPackages/react-test-renderer/jsx/index.js +1 -3
- package/dist/module/SubPackages/react-test-renderer/jsx/web.js +1 -1
- package/dist/module/SubPackages/react-test-renderer/jsx-promised/index.js +1 -1
- package/dist/module/Types.js +3 -30
- package/dist/module/Web.js +26 -38
- package/dist/module/esbuildConfigs/index.js +5 -5
- package/dist/module/esbuildConfigs/node.js +17 -15
- package/dist/module/esbuildConfigs/report.js +11 -48
- package/dist/module/esbuildConfigs/tests.js +0 -1
- package/dist/module/esbuildConfigs/web.js +17 -12
- package/dist/module/lib/abstractBase.js +190 -35
- package/dist/module/lib/basebuilder.js +56 -29
- package/dist/module/lib/classBuilder.js +8 -5
- package/dist/module/lib/core.js +44 -19
- package/dist/module/lib/index.js +11 -8
- package/dist/module/preload.js +15 -27
- package/dist/module/puppeteerConfiger.js +19 -0
- package/dist/module/tsconfig.module.tsbuildinfo +1 -1
- package/dist/prebuild/Report.css +1616 -584
- package/dist/prebuild/Report.js +2635 -2506
- package/dist/types/Node.d.ts +3 -2
- package/dist/types/PM/index.d.ts +19 -0
- package/dist/types/PM/main.d.ts +28 -0
- package/dist/types/PM/node.d.ts +26 -0
- package/dist/types/PM/web.d.ts +24 -0
- package/dist/types/Project.d.ts +1 -2
- package/dist/types/Puppeteer.d.ts +1 -0
- package/dist/types/Reporter.d.ts +1 -0
- package/dist/types/Scheduler.d.ts +0 -0
- package/dist/types/SubPackages/puppeteer.d.ts +3 -3
- package/dist/types/SubPackages/react/component/node.d.ts +1 -1
- package/dist/types/SubPackages/react/component/web.d.ts +1 -1
- package/dist/types/SubPackages/react/jsx/index.d.ts +1 -1
- package/dist/types/SubPackages/react/jsx/node.d.ts +1 -1
- package/dist/types/SubPackages/react/jsx/web.d.ts +2 -2
- package/dist/types/SubPackages/react-dom/component/node.d.ts +2 -2
- package/dist/types/SubPackages/react-dom/component/web.d.ts +1 -1
- package/dist/types/SubPackages/react-dom/jsx/node.d.ts +1 -1
- package/dist/types/SubPackages/react-dom/jsx/web.d.ts +1 -1
- package/dist/types/SubPackages/react-test-renderer/MemoExoticComponent/node.d.ts +1 -1
- package/dist/types/SubPackages/react-test-renderer/component/index.d.ts +1 -1
- package/dist/types/SubPackages/react-test-renderer/component/node.d.ts +1 -1
- package/dist/types/SubPackages/react-test-renderer/component/web.d.ts +1 -1
- package/dist/types/SubPackages/react-test-renderer/fc/node.d.ts +1 -1
- package/dist/types/SubPackages/react-test-renderer/fc/web.d.ts +1 -1
- package/dist/types/SubPackages/react-test-renderer/jsx/node.d.ts +1 -1
- package/dist/types/SubPackages/react-test-renderer/jsx/web.d.ts +3 -3
- package/dist/types/SubPackages/react-test-renderer/jsx-promised/index.d.ts +1 -1
- package/dist/types/SubPackages/react-test-renderer/jsx-promised/node.d.ts +1 -1
- package/dist/types/SubPackages/react-test-renderer/jsx-promised/web.d.ts +1 -1
- package/dist/types/Types.d.ts +19 -100
- package/dist/types/Web.d.ts +3 -2
- package/dist/types/esbuildConfigs/features.d.ts +1 -1
- package/dist/types/esbuildConfigs/index.d.ts +1 -1
- package/dist/types/esbuildConfigs/node.d.ts +1 -1
- package/dist/types/esbuildConfigs/report.d.ts +4 -0
- package/dist/types/esbuildConfigs/tests.d.ts +1 -1
- package/dist/types/esbuildConfigs/web.d.ts +1 -1
- package/dist/types/lib/abstractBase.d.ts +26 -24
- package/dist/types/lib/basebuilder.d.ts +10 -7
- package/dist/types/lib/classBuilder.d.ts +4 -3
- package/dist/types/lib/core.d.ts +5 -4
- package/dist/types/lib/index.d.ts +7 -5
- package/dist/types/lib/types.d.ts +62 -0
- package/dist/types/preload.d.ts +0 -1
- package/dist/types/puppeteerConfiger.d.ts +4 -0
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/package.json +6 -7
- package/src/Node.ts +30 -85
- package/src/PM/index.ts +102 -0
- package/src/PM/main.ts +420 -0
- package/src/PM/node.ts +515 -0
- package/src/PM/web.ts +497 -0
- package/src/Project.ts +183 -619
- package/src/Puppeteer.ts +131 -0
- package/src/Report.tsx +158 -44
- package/src/Reporter.ts +134 -0
- package/src/Scheduler.ts +0 -0
- package/src/SubPackages/puppeteer.ts +19 -14
- package/src/SubPackages/react/component/node.ts +20 -32
- package/src/SubPackages/react/component/web.ts +20 -30
- package/src/SubPackages/react/jsx/index.ts +13 -24
- package/src/SubPackages/react/jsx/node.ts +5 -8
- package/src/SubPackages/react/jsx/web.ts +10 -8
- package/src/SubPackages/react-dom/component/node.ts +17 -23
- package/src/SubPackages/react-dom/component/web.ts +134 -95
- package/src/SubPackages/react-dom/jsx/web.ts +41 -48
- package/src/SubPackages/react-test-renderer/MemoExoticComponent/node.ts +27 -37
- package/src/SubPackages/react-test-renderer/component/index.ts +16 -30
- package/src/SubPackages/react-test-renderer/component/node.ts +5 -11
- package/src/SubPackages/react-test-renderer/component/web.ts +5 -11
- package/src/SubPackages/react-test-renderer/fc/node.ts +36 -50
- package/src/SubPackages/react-test-renderer/fc/web.ts +37 -50
- package/src/SubPackages/react-test-renderer/jsx/index.ts +15 -21
- package/src/SubPackages/react-test-renderer/jsx/node.ts +6 -10
- package/src/SubPackages/react-test-renderer/jsx/web.ts +7 -7
- package/src/SubPackages/react-test-renderer/jsx-promised/index.ts +13 -16
- package/src/Types.ts +73 -307
- package/src/Web.ts +40 -81
- package/src/cjs-shim.js +2 -2
- package/src/esbuildConfigs/features.ts +3 -4
- package/src/esbuildConfigs/index.ts +8 -8
- package/src/esbuildConfigs/node.ts +21 -20
- package/src/esbuildConfigs/report.ts +15 -51
- package/src/esbuildConfigs/tests.ts +3 -9
- package/src/esbuildConfigs/web.ts +22 -20
- package/src/lib/abstractBase.ts +312 -164
- package/src/lib/basebuilder.ts +123 -127
- package/src/lib/classBuilder.ts +30 -48
- package/src/lib/core.ts +115 -84
- package/src/lib/index.ts +58 -56
- package/src/lib/types.ts +197 -0
- package/src/preload.ts +14 -30
- package/src/puppeteerConfiger.ts +26 -0
- package/src/web.html.ts +1 -1
- package/dist/common/NodeWriter.js +0 -56
- package/dist/common/electron.js +0 -196
- package/dist/common/lib/browser.js +0 -26
- package/dist/common/nodeWriterElectron.js +0 -55
- package/dist/module/NodeWriter.js +0 -50
- package/dist/module/electron.js +0 -191
- package/dist/module/lib/browser.js +0 -22
- package/dist/module/nodeWriterElectron.js +0 -52
- package/dist/types/NodeWriter.d.ts +0 -2
- package/dist/types/lib/browser.d.ts +0 -6
- package/dist/types/nodeWriterElectron.d.ts +0 -2
- package/src/NodeWriter.ts +0 -69
- package/src/electron.ts +0 -250
- package/src/lib/browser.ts +0 -34
- package/src/nodeWriterElectron.ts +0 -71
- package/yarn-error.log +0 -3144
- /package/dist/{types/electron.d.ts → module/lib/types.js} +0 -0
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { BaseBuilder } from "./basebuilder.js";
|
|
2
2
|
export class ClassBuilder extends BaseBuilder {
|
|
3
|
-
constructor(testImplementation, testSpecification, input, suiteKlasser, givenKlasser, whenKlasser, thenKlasser, checkKlasser, testResourceRequirement
|
|
3
|
+
constructor(testImplementation, testSpecification, input, suiteKlasser, givenKlasser, whenKlasser, thenKlasser, checkKlasser, testResourceRequirement
|
|
4
|
+
// puppetMaster: PM
|
|
5
|
+
) {
|
|
4
6
|
const classySuites = Object.entries(testImplementation.suites).reduce((a, [key], index) => {
|
|
5
7
|
a[key] = (somestring, givens, checks) => {
|
|
6
8
|
return new suiteKlasser.prototype.constructor(somestring, index, givens, checks);
|
|
7
9
|
};
|
|
8
10
|
return a;
|
|
9
11
|
}, {});
|
|
10
|
-
const classyGivens = Object.entries(testImplementation.givens)
|
|
11
|
-
.reduce((a, [key, givEn]) => {
|
|
12
|
+
const classyGivens = Object.entries(testImplementation.givens).reduce((a, [key, givEn]) => {
|
|
12
13
|
a[key] = (features, whens, thens, givEn) => {
|
|
13
|
-
return new
|
|
14
|
+
return new givenKlasser.prototype.constructor(key, features, whens, thens, testImplementation.givens[key], givEn);
|
|
14
15
|
};
|
|
15
16
|
return a;
|
|
16
17
|
}, {});
|
|
@@ -32,6 +33,8 @@ export class ClassBuilder extends BaseBuilder {
|
|
|
32
33
|
};
|
|
33
34
|
return a;
|
|
34
35
|
}, {});
|
|
35
|
-
super(input, classySuites, classyGivens, classyWhens, classyThens, classyChecks,
|
|
36
|
+
super(input, classySuites, classyGivens, classyWhens, classyThens, classyChecks, testResourceRequirement, testSpecification
|
|
37
|
+
// puppetMaster
|
|
38
|
+
);
|
|
36
39
|
}
|
|
37
40
|
}
|
package/dist/module/lib/core.js
CHANGED
|
@@ -1,31 +1,54 @@
|
|
|
1
|
-
import { DefaultTestInterface, defaultTestResourceRequirement } from "./index.js";
|
|
2
|
-
import { BaseSuite, BaseGiven, BaseWhen, BaseThen, BaseCheck } from "./abstractBase.js";
|
|
1
|
+
import { DefaultTestInterface, defaultTestResourceRequirement, } from "./index.js";
|
|
2
|
+
import { BaseSuite, BaseGiven, BaseWhen, BaseThen, BaseCheck, } from "./abstractBase.js";
|
|
3
3
|
import { ClassBuilder } from "./classBuilder.js";
|
|
4
4
|
export default class Testeranto extends ClassBuilder {
|
|
5
|
-
constructor(input, testSpecification, testImplementation, testResourceRequirement = defaultTestResourceRequirement,
|
|
5
|
+
constructor(input, testSpecification, testImplementation, testResourceRequirement = defaultTestResourceRequirement, testInterface
|
|
6
|
+
// puppetMaster: PM
|
|
7
|
+
) {
|
|
6
8
|
const fullTestInterface = DefaultTestInterface(testInterface);
|
|
7
9
|
super(testImplementation, testSpecification, input, class extends BaseSuite {
|
|
10
|
+
afterAll(store, artifactory, pm) {
|
|
11
|
+
// const pagesHandler = {
|
|
12
|
+
// get(target, prop) {
|
|
13
|
+
// console.log(`Getting pages property ${prop}`);
|
|
14
|
+
// return target[prop];
|
|
15
|
+
// },
|
|
16
|
+
// };
|
|
17
|
+
// const browserHandler = {
|
|
18
|
+
// get(target, prop) {
|
|
19
|
+
// console.log(`Getting browser property ${prop}`);
|
|
20
|
+
// if (prop === "pages") {
|
|
21
|
+
// // return target[prop];
|
|
22
|
+
// return new Proxy(target[prop], pagesHandler);
|
|
23
|
+
// } else {
|
|
24
|
+
// return target[prop];
|
|
25
|
+
// }
|
|
26
|
+
// },
|
|
27
|
+
// };
|
|
28
|
+
// const proxy = new Proxy(utils.browser, browserHandler);
|
|
29
|
+
return fullTestInterface.afterAll(store, (fPath, value) => {
|
|
30
|
+
artifactory(`afterAll4-${this.name}/${fPath}`, value);
|
|
31
|
+
}, pm);
|
|
32
|
+
}
|
|
8
33
|
assertThat(t) {
|
|
9
34
|
fullTestInterface.assertThis(t);
|
|
10
35
|
}
|
|
11
|
-
async setup(s, artifactory, tr) {
|
|
12
|
-
return (fullTestInterface.beforeAll ||
|
|
36
|
+
async setup(s, artifactory, tr, pm) {
|
|
37
|
+
return (fullTestInterface.beforeAll ||
|
|
38
|
+
(async (input, artifactory, tr, pm) => input))(s, this.testResourceConfiguration, artifactory, pm);
|
|
13
39
|
}
|
|
14
40
|
}, class Given extends BaseGiven {
|
|
15
|
-
async givenThat(subject, testResource, artifactory, initializer) {
|
|
41
|
+
async givenThat(subject, testResource, artifactory, initializer, pm) {
|
|
16
42
|
return fullTestInterface.beforeEach(subject, initializer, (fPath, value) =>
|
|
17
43
|
// TODO does not work?
|
|
18
|
-
artifactory(`beforeEach/${fPath}`, value), testResource, this.initialValues);
|
|
19
|
-
}
|
|
20
|
-
afterEach(store, key, artifactory) {
|
|
21
|
-
return new Promise((res) => res(fullTestInterface.afterEach(store, key, (fPath, value) => artifactory(`after/${fPath}`, value))));
|
|
44
|
+
artifactory(`beforeEach/${fPath}`, value), testResource, this.initialValues, pm);
|
|
22
45
|
}
|
|
23
|
-
|
|
24
|
-
return fullTestInterface.
|
|
46
|
+
afterEach(store, key, artifactory, pm) {
|
|
47
|
+
return new Promise((res) => res(fullTestInterface.afterEach(store, key, (fPath, value) => artifactory(`after/${fPath}`, value), pm)));
|
|
25
48
|
}
|
|
26
49
|
}, class When extends BaseWhen {
|
|
27
|
-
async andWhen(store, whenCB, testResource) {
|
|
28
|
-
return await fullTestInterface.andWhen(store, whenCB, testResource);
|
|
50
|
+
async andWhen(store, whenCB, testResource, pm) {
|
|
51
|
+
return await fullTestInterface.andWhen(store, whenCB, testResource, pm);
|
|
29
52
|
}
|
|
30
53
|
}, class Then extends BaseThen {
|
|
31
54
|
async butThen(store, thenCB, testResourceConfiguration) {
|
|
@@ -36,14 +59,16 @@ export default class Testeranto extends ClassBuilder {
|
|
|
36
59
|
super(name, features, checkCallback, whens, thens);
|
|
37
60
|
this.initialValues = initialValues;
|
|
38
61
|
}
|
|
39
|
-
async checkThat(subject, testResourceConfiguration, artifactory) {
|
|
40
|
-
return fullTestInterface.beforeEach(subject, this.initialValues, (fPath, value) => artifactory(`before/${fPath}`, value), testResourceConfiguration, this.initialValues);
|
|
62
|
+
async checkThat(subject, testResourceConfiguration, artifactory, pm) {
|
|
63
|
+
return fullTestInterface.beforeEach(subject, this.initialValues, (fPath, value) => artifactory(`before/${fPath}`, value), testResourceConfiguration, this.initialValues, pm);
|
|
41
64
|
}
|
|
42
|
-
afterEach(store, key, artifactory) {
|
|
65
|
+
afterEach(store, key, artifactory, pm) {
|
|
43
66
|
return new Promise((res) => res(fullTestInterface.afterEach(store, key, (fPath, value) =>
|
|
44
67
|
// TODO does not work?
|
|
45
|
-
artifactory(`afterEach2-${this.name}/${fPath}`, value))));
|
|
68
|
+
artifactory(`afterEach2-${this.name}/${fPath}`, value), pm)));
|
|
46
69
|
}
|
|
47
|
-
}, testResourceRequirement
|
|
70
|
+
}, testResourceRequirement
|
|
71
|
+
// puppetMaster
|
|
72
|
+
);
|
|
48
73
|
}
|
|
49
74
|
}
|
package/dist/module/lib/index.js
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
1
|
+
// import { INodeUtils, ITestInterface, IUtils, IWebUtils } from "./types.js";
|
|
1
2
|
export const BaseTestInterface = {
|
|
2
|
-
beforeAll:
|
|
3
|
-
beforeEach: async function (subject, initialValues, testResource) {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
beforeAll: async (s) => s,
|
|
4
|
+
beforeEach: async function (subject, initialValues, x, testResource, pm) {
|
|
5
|
+
return subject;
|
|
6
|
+
},
|
|
7
|
+
afterEach: async (s) => s,
|
|
8
|
+
afterAll: (store) => undefined,
|
|
9
|
+
butThen: async (store, thenCb) => thenCb(store),
|
|
10
|
+
andWhen: (a) => a,
|
|
11
|
+
assertThis: () => null,
|
|
9
12
|
};
|
|
10
13
|
export const DefaultTestInterface = (p) => {
|
|
11
14
|
return Object.assign(Object.assign({}, BaseTestInterface), p);
|
|
12
15
|
};
|
|
13
16
|
export const defaultTestResourceRequirement = {
|
|
14
|
-
ports: 0
|
|
17
|
+
ports: 0,
|
|
15
18
|
};
|
package/dist/module/preload.js
CHANGED
|
@@ -1,27 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { NodeWriter } from "./NodeWriter";
|
|
4
|
-
|
|
5
|
-
window
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
//
|
|
11
|
-
//
|
|
12
|
-
//
|
|
13
|
-
//
|
|
14
|
-
//
|
|
15
|
-
//
|
|
16
|
-
// oldLog.apply(console, arguments);
|
|
17
|
-
// };
|
|
18
|
-
// var oldLog = console.warn;
|
|
19
|
-
// console.warn = function (message) {
|
|
20
|
-
// ipcRenderer.invoke('web-warn', message.toString());
|
|
21
|
-
// oldLog.apply(console, arguments);
|
|
22
|
-
// };
|
|
23
|
-
// var oldLog = console.info;
|
|
24
|
-
// console.info = function (message) {
|
|
25
|
-
// ipcRenderer.invoke('web-info', message.toString());
|
|
26
|
-
// oldLog.apply(console, arguments);
|
|
27
|
-
// };
|
|
1
|
+
"use strict";
|
|
2
|
+
// import puppeteer from "puppeteer-core";
|
|
3
|
+
// import { NodeWriter } from "./NodeWriter";
|
|
4
|
+
// import puppeteerConfiger from "./puppeteerConfiger";
|
|
5
|
+
// (window as any).NodeWriter = NodeWriter;
|
|
6
|
+
// (window as any).browser = new Promise(async (res, rej) => {
|
|
7
|
+
// const browser = await puppeteerConfiger("2999").then(async (json) => {
|
|
8
|
+
// const b = await puppeteer.connect({
|
|
9
|
+
// browserWSEndpoint: json.webSocketDebuggerUrl,
|
|
10
|
+
// defaultViewport: null,
|
|
11
|
+
// });
|
|
12
|
+
// console.log("connected!", b.isConnected());
|
|
13
|
+
// return res(b);
|
|
14
|
+
// });
|
|
15
|
+
// });
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import http from "http";
|
|
2
|
+
export default async (port) => new Promise((resolve, reject) => {
|
|
3
|
+
let json = "";
|
|
4
|
+
const request = http.request({
|
|
5
|
+
host: "127.0.0.1",
|
|
6
|
+
path: "/json/version",
|
|
7
|
+
port,
|
|
8
|
+
}, (response) => {
|
|
9
|
+
response.on("error", reject);
|
|
10
|
+
response.on("data", (chunk) => {
|
|
11
|
+
json += chunk.toString();
|
|
12
|
+
});
|
|
13
|
+
response.on("end", () => {
|
|
14
|
+
resolve(JSON.parse(json));
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
request.on("error", reject);
|
|
18
|
+
request.end();
|
|
19
|
+
});
|