testeranto 0.49.10 → 0.70.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/.nvmrc +1 -0
- package/README.md +92 -9
- package/dist/cjs-shim.js +12 -0
- package/dist/common/Features.js +2 -3
- package/dist/common/Node.js +37 -62
- package/dist/common/NodeWriter.js +7 -9
- package/dist/common/Project.js +130 -627
- package/dist/common/SubPackages/puppeteer.js +19 -0
- package/dist/common/{subPackages → SubPackages}/react/component/node.js +4 -4
- package/dist/common/{subPackages → SubPackages}/react/component/web.js +4 -4
- package/dist/common/SubPackages/react/jsx/index.js +13 -0
- package/dist/common/SubPackages/react/jsx/node.js +10 -0
- package/dist/common/SubPackages/react/jsx/web.js +10 -0
- package/dist/common/{subPackages → SubPackages}/react-dom/component/node.js +6 -6
- package/dist/common/{subPackages → SubPackages}/react-dom/component/web.js +11 -12
- package/dist/common/SubPackages/react-dom/jsx/node.js +39 -0
- package/dist/common/{subPackages → SubPackages}/react-dom/jsx/web.js +19 -20
- package/dist/common/{subPackages → SubPackages}/react-test-renderer/MemoExoticComponent/node.js +3 -3
- package/dist/common/{subPackages → SubPackages}/react-test-renderer/component/index.js +25 -15
- package/dist/common/{subPackages/react-test-renderer/jsx → SubPackages/react-test-renderer/component}/node.js +3 -5
- package/dist/common/{subPackages/react-test-renderer/jsx → SubPackages/react-test-renderer/component}/web.js +3 -5
- package/dist/common/{subPackages → SubPackages}/react-test-renderer/fc/node.js +4 -4
- package/dist/common/{subPackages → SubPackages}/react-test-renderer/fc/web.js +4 -4
- package/dist/common/{subPackages → SubPackages}/react-test-renderer/jsx/index.js +8 -3
- package/dist/common/{subPackages/react-test-renderer/jsx-promised → SubPackages/react-test-renderer/jsx}/node.js +4 -4
- package/dist/common/{subPackages/react → SubPackages/react-test-renderer}/jsx/web.js +4 -4
- package/dist/common/{subPackages → SubPackages}/react-test-renderer/jsx-promised/index.js +3 -3
- package/dist/common/{subPackages/react/jsx → SubPackages/react-test-renderer/jsx-promised}/node.js +2 -2
- package/dist/common/Types.js +2 -0
- package/dist/common/Web.js +49 -113
- package/dist/common/electron.js +256 -42
- package/dist/common/esbuildConfigs/features.js +14 -0
- package/dist/common/esbuildConfigs/index.js +20 -0
- package/dist/common/esbuildConfigs/node.js +37 -0
- package/dist/common/esbuildConfigs/report.js +13 -0
- package/dist/common/esbuildConfigs/tests.js +13 -0
- package/dist/common/esbuildConfigs/web.js +53 -0
- package/dist/common/lib/abstractBase.js +200 -0
- package/dist/common/lib/basebuilder.js +86 -0
- package/dist/common/lib/classBuilder.js +40 -0
- package/dist/common/lib/core.js +81 -0
- package/dist/common/lib/index.js +21 -0
- package/dist/common/lib/types.js +2 -0
- package/dist/common/preload.js +15 -24
- package/dist/common/puppeteerConfiger.js +24 -0
- package/dist/common/report.html.js +31 -0
- package/dist/common/tsconfig.common.tsbuildinfo +1 -1
- package/dist/common/web.html.js +22 -0
- package/dist/module/Features.js +2 -3
- package/dist/module/Node.js +37 -62
- package/dist/module/NodeWriter.js +7 -9
- package/dist/module/Project.js +131 -605
- package/dist/module/SubPackages/puppeteer.js +14 -0
- package/dist/module/{subPackages → SubPackages}/react/component/node.js +3 -3
- package/dist/module/{subPackages → SubPackages}/react/component/web.js +3 -3
- package/dist/module/SubPackages/react/jsx/index.js +10 -0
- package/dist/module/SubPackages/react/jsx/node.js +5 -0
- package/dist/module/SubPackages/react/jsx/web.js +5 -0
- package/dist/module/{subPackages → SubPackages}/react-dom/component/node.js +7 -7
- package/dist/module/{subPackages → SubPackages}/react-dom/component/web.js +10 -11
- package/dist/module/SubPackages/react-dom/jsx/node.js +31 -0
- package/dist/module/{subPackages → SubPackages}/react-dom/jsx/web.js +20 -21
- package/dist/module/{subPackages → SubPackages}/react-test-renderer/MemoExoticComponent/node.js +3 -3
- package/dist/module/{subPackages → SubPackages}/react-test-renderer/component/index.js +22 -15
- package/dist/module/{subPackages → SubPackages}/react-test-renderer/component/node.js +2 -2
- package/dist/module/{subPackages → SubPackages}/react-test-renderer/component/web.js +2 -2
- package/dist/module/{subPackages → SubPackages}/react-test-renderer/fc/node.js +3 -3
- package/dist/module/{subPackages → SubPackages}/react-test-renderer/fc/web.js +3 -3
- package/dist/module/{subPackages → SubPackages}/react-test-renderer/jsx/index.js +8 -3
- package/dist/module/SubPackages/react-test-renderer/jsx/node.js +5 -0
- package/dist/module/SubPackages/react-test-renderer/jsx/web.js +5 -0
- package/dist/module/{subPackages → SubPackages}/react-test-renderer/jsx-promised/index.js +3 -3
- package/dist/module/{subPackages/react-test-renderer/jsx → SubPackages/react-test-renderer/jsx-promised}/node.js +1 -1
- package/dist/module/Types.js +2 -0
- package/dist/module/Web.js +49 -113
- package/dist/module/electron.js +257 -43
- package/dist/module/esbuildConfigs/features.js +12 -0
- package/dist/module/esbuildConfigs/index.js +18 -0
- package/dist/module/esbuildConfigs/node.js +32 -0
- package/dist/module/esbuildConfigs/report.js +11 -0
- package/dist/module/esbuildConfigs/tests.js +11 -0
- package/dist/module/esbuildConfigs/web.js +48 -0
- package/dist/module/lib/abstractBase.js +192 -0
- package/dist/module/lib/basebuilder.js +82 -0
- package/dist/module/lib/classBuilder.js +36 -0
- package/dist/module/lib/core.js +78 -0
- package/dist/module/lib/index.js +17 -0
- package/dist/module/lib/types.js +1 -0
- package/dist/module/preload.js +12 -24
- package/dist/module/puppeteerConfiger.js +19 -0
- package/dist/module/report.html.js +29 -0
- package/dist/module/tsconfig.module.tsbuildinfo +1 -1
- package/dist/module/web.html.js +20 -0
- package/dist/prebuild/Report.css +10326 -0
- package/dist/prebuild/Report.js +37456 -0
- package/dist/types/Features.d.ts +5 -5
- package/dist/types/Node.d.ts +5 -11
- package/dist/types/NodeWriter.d.ts +1 -1
- package/dist/types/Project.d.ts +2 -28
- package/dist/types/SubPackages/puppeteer.d.ts +6 -0
- package/dist/types/SubPackages/react/component/node.d.ts +7 -0
- package/dist/types/SubPackages/react/component/web.d.ts +7 -0
- package/dist/types/SubPackages/react/jsx/index.d.ts +15 -0
- package/dist/types/SubPackages/react/jsx/node.d.ts +4 -0
- package/dist/types/SubPackages/react/jsx/web.d.ts +4 -0
- package/dist/types/SubPackages/react-dom/component/node.d.ts +12 -0
- package/dist/types/SubPackages/react-dom/component/web.d.ts +5 -0
- package/dist/types/SubPackages/react-dom/jsx/node.d.ts +6 -0
- package/dist/types/SubPackages/react-dom/jsx/web.d.ts +5 -0
- package/dist/types/SubPackages/react-test-renderer/MemoExoticComponent/node.d.ts +5 -0
- package/dist/types/{subPackages → SubPackages}/react-test-renderer/component/index.d.ts +6 -6
- package/dist/types/{subPackages → SubPackages}/react-test-renderer/component/node.d.ts +4 -4
- package/dist/types/SubPackages/react-test-renderer/component/web.d.ts +4 -0
- package/dist/types/SubPackages/react-test-renderer/fc/node.d.ts +8 -0
- package/dist/types/SubPackages/react-test-renderer/fc/web.d.ts +8 -0
- package/dist/types/{subPackages → SubPackages}/react-test-renderer/jsx/index.d.ts +5 -4
- package/dist/types/SubPackages/react-test-renderer/jsx/node.d.ts +9 -0
- package/dist/types/SubPackages/react-test-renderer/jsx/web.d.ts +9 -0
- package/dist/types/{subPackages → SubPackages}/react-test-renderer/jsx-promised/index.d.ts +4 -4
- package/dist/types/SubPackages/react-test-renderer/jsx-promised/node.d.ts +5 -0
- package/dist/types/SubPackages/react-test-renderer/jsx-promised/web.d.ts +5 -0
- package/dist/types/Types.d.ts +49 -17
- package/dist/types/Web.d.ts +5 -11
- package/dist/types/esbuildConfigs/features.d.ts +4 -0
- package/dist/types/esbuildConfigs/index.d.ts +4 -0
- package/dist/types/esbuildConfigs/node.d.ts +4 -0
- package/dist/types/esbuildConfigs/report.d.ts +4 -0
- package/dist/types/esbuildConfigs/tests.d.ts +4 -0
- package/dist/types/esbuildConfigs/web.d.ts +4 -0
- package/dist/types/lib/abstractBase.d.ts +103 -0
- package/dist/types/lib/basebuilder.d.ts +25 -0
- package/dist/types/lib/classBuilder.d.ts +7 -0
- package/dist/types/lib/core.d.ts +8 -0
- package/dist/types/lib/index.d.ts +58 -0
- package/dist/types/lib/types.d.ts +70 -0
- package/dist/types/puppeteerConfiger.d.ts +4 -0
- package/dist/types/report.html.d.ts +2 -0
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/dist/types/web.html.d.ts +2 -0
- package/electronBuild.ts +32 -0
- package/index.html +30 -0
- package/package.json +123 -87
- package/src/Features.ts +2 -4
- package/src/Node.ts +79 -155
- package/src/NodeWriter.ts +22 -22
- package/src/Project.ts +185 -783
- package/src/Report.tsx +30 -15
- package/src/SubPackages/puppeteer.ts +51 -0
- package/src/SubPackages/react/component/node.ts +43 -0
- package/src/SubPackages/react/component/web.ts +43 -0
- package/src/SubPackages/react/jsx/index.ts +32 -0
- package/src/SubPackages/react/jsx/node.ts +29 -0
- package/src/SubPackages/react/jsx/web.ts +30 -0
- package/src/{subPackages → SubPackages}/react-dom/component/node.ts +24 -44
- package/src/SubPackages/react-dom/component/web.ts +104 -0
- package/src/{subPackages → SubPackages}/react-dom/jsx/index.ts +0 -1
- package/src/SubPackages/react-dom/jsx/node.ts +68 -0
- package/src/SubPackages/react-dom/jsx/web.ts +102 -0
- package/src/SubPackages/react-test-renderer/MemoExoticComponent/node.ts +38 -0
- package/src/{subPackages → SubPackages}/react-test-renderer/component/index.ts +37 -49
- package/src/SubPackages/react-test-renderer/component/node.ts +16 -0
- package/src/SubPackages/react-test-renderer/component/web.ts +16 -0
- package/src/SubPackages/react-test-renderer/fc/node.ts +49 -0
- package/src/SubPackages/react-test-renderer/fc/web.ts +48 -0
- package/src/SubPackages/react-test-renderer/jsx/index.ts +49 -0
- package/src/SubPackages/react-test-renderer/jsx/node.ts +20 -0
- package/src/SubPackages/react-test-renderer/jsx/web.ts +20 -0
- package/src/{subPackages → SubPackages}/react-test-renderer/jsx-promised/index.ts +15 -26
- package/src/SubPackages/react-test-renderer/jsx-promised/node.ts +19 -0
- package/src/SubPackages/react-test-renderer/jsx-promised/web.ts +22 -0
- package/src/Types.ts +114 -17
- package/src/Web.ts +100 -225
- package/src/cjs-shim.js +12 -0
- package/src/electron.ts +303 -45
- package/src/esbuildConfigs/features.ts +17 -0
- package/src/esbuildConfigs/index.ts +22 -0
- package/src/esbuildConfigs/node.ts +60 -0
- package/src/esbuildConfigs/report.ts +15 -0
- package/src/esbuildConfigs/tests.ts +14 -0
- package/src/esbuildConfigs/web.ts +73 -0
- package/src/lib/abstractBase.ts +412 -0
- package/src/lib/basebuilder.ts +228 -0
- package/src/lib/classBuilder.ts +118 -0
- package/src/lib/core.ts +214 -0
- package/src/lib/index.ts +117 -0
- package/src/lib/types.ts +206 -0
- package/src/preload.ts +13 -27
- package/src/puppeteerConfiger.ts +26 -0
- package/src/report.html.ts +29 -0
- package/src/web.html.ts +20 -0
- package/tests/Rectangle.test.ts +189 -0
- package/tsconfig.json +19 -6
- package/tsconfig.module.json +15 -4
- package/tsconfig.types.json +14 -4
- package/yarn-error.log +3144 -0
- package/dist/common/core.js +0 -397
- package/dist/common/subPackages/react/jsx/index.js +0 -26
- package/dist/common/subPackages/react-dom/jsx/node.js +0 -95
- package/dist/common/subPackages/react-test-renderer/component/node.js +0 -8
- package/dist/common/subPackages/react-test-renderer/component/web.js +0 -8
- package/dist/module/Report.js +0 -186
- package/dist/module/core.js +0 -388
- package/dist/module/subPackages/react/jsx/index.js +0 -22
- package/dist/module/subPackages/react/jsx/node.js +0 -5
- package/dist/module/subPackages/react/jsx/web.js +0 -5
- package/dist/module/subPackages/react-dom/jsx/node.js +0 -87
- package/dist/module/subPackages/react-test-renderer/jsx/web.js +0 -5
- package/dist/module/subPackages/react-test-renderer/jsx-promised/node.js +0 -5
- package/dist/types/core.d.ts +0 -220
- package/dist/types/subPackages/react/component/node.d.ts +0 -12
- package/dist/types/subPackages/react/component/web.d.ts +0 -12
- package/dist/types/subPackages/react/jsx/index.d.ts +0 -15
- package/dist/types/subPackages/react/jsx/node.d.ts +0 -4
- package/dist/types/subPackages/react/jsx/web.d.ts +0 -4
- package/dist/types/subPackages/react-dom/component/node.d.ts +0 -14
- package/dist/types/subPackages/react-dom/component/web.d.ts +0 -19
- package/dist/types/subPackages/react-dom/jsx/node.d.ts +0 -8
- package/dist/types/subPackages/react-dom/jsx/web.d.ts +0 -5
- package/dist/types/subPackages/react-test-renderer/MemoExoticComponent/node.d.ts +0 -8
- package/dist/types/subPackages/react-test-renderer/component/web.d.ts +0 -9
- package/dist/types/subPackages/react-test-renderer/fc/node.d.ts +0 -9
- package/dist/types/subPackages/react-test-renderer/fc/web.d.ts +0 -9
- package/dist/types/subPackages/react-test-renderer/jsx/node.d.ts +0 -4
- package/dist/types/subPackages/react-test-renderer/jsx/web.d.ts +0 -4
- package/dist/types/subPackages/react-test-renderer/jsx-promised/node.d.ts +0 -4
- package/dist/types/subPackages/react-test-renderer/jsx-promised/web.d.ts +0 -4
- package/src/core.ts +0 -1399
- package/src/subPackages/react/component/node.ts +0 -75
- package/src/subPackages/react/component/web.ts +0 -80
- package/src/subPackages/react/jsx/index.ts +0 -64
- package/src/subPackages/react/jsx/node.ts +0 -29
- package/src/subPackages/react/jsx/web.ts +0 -29
- package/src/subPackages/react-dom/component/web.ts +0 -129
- package/src/subPackages/react-dom/jsx/node.ts +0 -145
- package/src/subPackages/react-dom/jsx/web.ts +0 -145
- package/src/subPackages/react-test-renderer/MemoExoticComponent/node.ts +0 -67
- package/src/subPackages/react-test-renderer/component/node.ts +0 -30
- package/src/subPackages/react-test-renderer/component/web.ts +0 -30
- package/src/subPackages/react-test-renderer/fc/node.ts +0 -77
- package/src/subPackages/react-test-renderer/fc/web.ts +0 -77
- package/src/subPackages/react-test-renderer/jsx/index.ts +0 -51
- package/src/subPackages/react-test-renderer/jsx/node.ts +0 -31
- package/src/subPackages/react-test-renderer/jsx/web.ts +0 -31
- package/src/subPackages/react-test-renderer/jsx-promised/node.ts +0 -31
- package/src/subPackages/react-test-renderer/jsx-promised/web.ts +0 -31
- /package/dist/common/{subPackages → SubPackages}/react-dom/jsx/index.js +0 -0
- /package/dist/common/{subPackages → SubPackages}/react-test-renderer/jsx-promised/web.js +0 -0
- /package/dist/module/{subPackages → SubPackages}/react-dom/jsx/index.js +0 -0
- /package/dist/module/{subPackages → SubPackages}/react-test-renderer/jsx-promised/web.js +0 -0
- /package/dist/types/{subPackages → SubPackages}/react-dom/jsx/index.d.ts +0 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Testeranto from "../Node.js";
|
|
3
|
+
export default (testInput, testSpecifications, testImplementations, testInterface) => {
|
|
4
|
+
return Testeranto(testInput, testSpecifications, testImplementations, Object.assign({ beforeAll(x) {
|
|
5
|
+
process.parentPort.postMessage(`/docs/web/src/ClassicalComponent/test.html`);
|
|
6
|
+
return x;
|
|
7
|
+
}, beforeEach: async () => {
|
|
8
|
+
return new Promise((resolve, rej) => {
|
|
9
|
+
resolve(React.createElement(testInput, {}, []));
|
|
10
|
+
});
|
|
11
|
+
}, andWhen: function (s, whenCB) {
|
|
12
|
+
return whenCB()(s);
|
|
13
|
+
} }, testInterface));
|
|
14
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import Testeranto from "../../../Node";
|
|
2
|
+
import Testeranto from "../../../Node.js";
|
|
3
3
|
export default (testImplementations, testSpecifications, testInput) => {
|
|
4
4
|
return Testeranto(testInput, testSpecifications, testImplementations, {
|
|
5
5
|
beforeEach: async () => {
|
|
@@ -7,8 +7,8 @@ export default (testImplementations, testSpecifications, testInput) => {
|
|
|
7
7
|
resolve(React.createElement(testInput, {}, []));
|
|
8
8
|
});
|
|
9
9
|
},
|
|
10
|
-
andWhen: function (s,
|
|
11
|
-
return
|
|
10
|
+
andWhen: function (s, whenCB) {
|
|
11
|
+
return whenCB()(s);
|
|
12
12
|
},
|
|
13
13
|
});
|
|
14
14
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import Testeranto from "../../../Web";
|
|
2
|
+
import Testeranto from "../../../Web.js";
|
|
3
3
|
export default (testImplementations, testSpecifications, testInput) => {
|
|
4
4
|
return Testeranto(testInput, testSpecifications, testImplementations, {
|
|
5
5
|
beforeEach: async () => {
|
|
@@ -7,8 +7,8 @@ export default (testImplementations, testSpecifications, testInput) => {
|
|
|
7
7
|
resolve(React.createElement(testInput, {}, []));
|
|
8
8
|
});
|
|
9
9
|
},
|
|
10
|
-
andWhen: function (s,
|
|
11
|
-
return
|
|
10
|
+
andWhen: function (s, whenCB) {
|
|
11
|
+
return whenCB()(s);
|
|
12
12
|
},
|
|
13
13
|
});
|
|
14
14
|
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import Testeranto from "../../../Node.js";
|
|
2
|
+
import { testInterface as baseInterface } from "./index.js";
|
|
3
|
+
export default (testImplementations, testSpecifications, testInput, testInterface) => {
|
|
4
|
+
return Testeranto(testInput, testSpecifications, testImplementations, Object.assign(Object.assign({}, baseInterface), testInterface));
|
|
5
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import Testeranto from "../../../Web.js";
|
|
2
|
+
import { testInterface as baseInterface, } from "./index.js";
|
|
3
|
+
export default (testImplementations, testSpecifications, testInput, testInterface) => {
|
|
4
|
+
return Testeranto(testInput, testSpecifications, testImplementations, Object.assign(Object.assign({}, baseInterface), testInterface));
|
|
5
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createElement } from "react";
|
|
2
|
-
import { renderToStaticMarkup, renderToStaticNodeStream } from "react-dom/server";
|
|
3
|
-
import Stream from
|
|
4
|
-
import Testeranto from "../../../Node";
|
|
2
|
+
import { renderToStaticMarkup, renderToStaticNodeStream, } from "react-dom/server";
|
|
3
|
+
import Stream from "stream";
|
|
4
|
+
import Testeranto from "../../../Node.js";
|
|
5
5
|
export { renderToStaticMarkup, renderToStaticNodeStream, Stream };
|
|
6
6
|
export default (testImplementations, testSpecifications, testInput) => {
|
|
7
7
|
return Testeranto(testInput, testSpecifications, testImplementations, {
|
|
@@ -22,9 +22,9 @@ export default (testImplementations, testSpecifications, testInput) => {
|
|
|
22
22
|
resolve(createElement(testInput));
|
|
23
23
|
});
|
|
24
24
|
},
|
|
25
|
-
andWhen: async function (s,
|
|
26
|
-
|
|
27
|
-
return s
|
|
25
|
+
andWhen: async function (s, whenCB) {
|
|
26
|
+
return whenCB(s);
|
|
27
|
+
// return s
|
|
28
28
|
},
|
|
29
29
|
butThen: async function (s) {
|
|
30
30
|
return s;
|
|
@@ -85,7 +85,7 @@ export default (testImplementations, testSpecifications, testInput) => {
|
|
|
85
85
|
// resolve(ReactDOMServer.renderToStaticMarkup(element));
|
|
86
86
|
// });
|
|
87
87
|
// },
|
|
88
|
-
// andWhen: function (s: IStore,
|
|
88
|
+
// andWhen: function (s: IStore, whenCB): Promise<ISelection> {
|
|
89
89
|
// throw new Error(`"andWhens" are not permitted`);
|
|
90
90
|
// }
|
|
91
91
|
// },
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { createElement } from "react";
|
|
2
2
|
import ReactDom from "react-dom/client";
|
|
3
|
-
import Testeranto from "../../../Web";
|
|
4
|
-
export default (
|
|
3
|
+
import Testeranto from "../../../Web.js";
|
|
4
|
+
export default (testInput, testSpecifications, testImplementations) => {
|
|
5
5
|
document.addEventListener("DOMContentLoaded", function () {
|
|
6
|
-
console.log("DOMContentLoaded");
|
|
7
6
|
const elem = document.getElementById("root");
|
|
8
7
|
if (elem) {
|
|
9
8
|
class TesterantoComponent extends testInput {
|
|
@@ -17,7 +16,8 @@ export default (testImplementations, testSpecifications, testInput) => {
|
|
|
17
16
|
}
|
|
18
17
|
}
|
|
19
18
|
return Testeranto(testInput, testSpecifications, testImplementations, {
|
|
20
|
-
beforeAll: async (
|
|
19
|
+
beforeAll: async (initialProps, artificer) => {
|
|
20
|
+
console.log("mark5", initialProps);
|
|
21
21
|
return await new Promise((resolve, rej) => {
|
|
22
22
|
const elem = document.getElementById("root");
|
|
23
23
|
if (elem) {
|
|
@@ -25,21 +25,20 @@ export default (testImplementations, testSpecifications, testInput) => {
|
|
|
25
25
|
}
|
|
26
26
|
});
|
|
27
27
|
},
|
|
28
|
-
beforeEach: async ({ htmlElement },
|
|
28
|
+
beforeEach: async ({ htmlElement }, initializer, testResource, artificer, initialValues) => {
|
|
29
29
|
return new Promise((resolve, rej) => {
|
|
30
|
+
// console.log("beforeEach" + JSON.stringify(initializer) + JSON.stringify(initialValues));
|
|
30
31
|
// Ignore these type errors
|
|
31
|
-
ReactDom.createRoot(htmlElement).render(createElement(TesterantoComponent, {
|
|
32
|
-
done: (reactElement) => {
|
|
32
|
+
ReactDom.createRoot(htmlElement).render(createElement(TesterantoComponent, Object.assign(Object.assign({}, initializer), { done: (reactElement) => {
|
|
33
33
|
resolve({
|
|
34
34
|
htmlElement,
|
|
35
35
|
reactElement,
|
|
36
36
|
});
|
|
37
|
-
}
|
|
38
|
-
}, []));
|
|
37
|
+
} }), []));
|
|
39
38
|
});
|
|
40
39
|
},
|
|
41
|
-
andWhen: function (s,
|
|
42
|
-
return
|
|
40
|
+
andWhen: function (s, whenCB) {
|
|
41
|
+
return whenCB(s);
|
|
43
42
|
},
|
|
44
43
|
butThen: async function (s) {
|
|
45
44
|
return s;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { createElement } from "react";
|
|
2
|
+
import { renderToStaticMarkup, renderToStaticNodeStream } from "react-dom/server";
|
|
3
|
+
import Stream from 'stream';
|
|
4
|
+
import Testeranto from "../../../Node.js";
|
|
5
|
+
export { renderToStaticMarkup, renderToStaticNodeStream, Stream };
|
|
6
|
+
export default (testImplementations, testSpecifications, testInput) => {
|
|
7
|
+
return Testeranto(testInput, testSpecifications, testImplementations, {
|
|
8
|
+
beforeAll: async (prototype, artificer) => {
|
|
9
|
+
return await new Promise((resolve, rej) => {
|
|
10
|
+
resolve(null);
|
|
11
|
+
});
|
|
12
|
+
},
|
|
13
|
+
beforeEach: async (reactComponent, ndx, testRsource, artificer) => {
|
|
14
|
+
return new Promise((resolve, rej) => {
|
|
15
|
+
resolve(createElement(testInput));
|
|
16
|
+
});
|
|
17
|
+
},
|
|
18
|
+
andWhen: async function (s, whenCB) {
|
|
19
|
+
return s;
|
|
20
|
+
},
|
|
21
|
+
butThen: async function (s) {
|
|
22
|
+
return s;
|
|
23
|
+
},
|
|
24
|
+
afterEach: async function (store, ndx, artificer) {
|
|
25
|
+
return {};
|
|
26
|
+
},
|
|
27
|
+
afterAll: (store, artificer) => {
|
|
28
|
+
return;
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
};
|
|
@@ -1,63 +1,62 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import React, { useEffect, useRef } from "react";
|
|
2
|
+
import { createPortal } from "react-dom";
|
|
3
|
+
import Testeranto from "../../../Web.js";
|
|
4
4
|
export default (testImplementations, testSpecifications, testInput) => {
|
|
5
5
|
document.addEventListener("DOMContentLoaded", function () {
|
|
6
|
-
console.log("DOMContentLoaded");
|
|
7
6
|
const rootElement = document.getElementById("root");
|
|
8
7
|
if (rootElement) {
|
|
9
|
-
const TesterantoComponent = function ({ done, innerComp }) {
|
|
8
|
+
const TesterantoComponent = function ({ done, innerComp, }) {
|
|
10
9
|
const myContainer = useRef(null);
|
|
11
10
|
useEffect(() => {
|
|
12
11
|
console.log("useEffect called", myContainer.current);
|
|
13
|
-
// if (!myContainer.current) {
|
|
14
|
-
// // do componentDidMount logic
|
|
15
|
-
// myContainer.current = true;
|
|
16
|
-
// } else {
|
|
17
|
-
// // do componentDidUpdate logic
|
|
18
|
-
// }
|
|
19
12
|
done(myContainer.current);
|
|
20
13
|
}, []);
|
|
21
|
-
return React.createElement(
|
|
14
|
+
return React.createElement("div", { ref: myContainer }, innerComp());
|
|
22
15
|
};
|
|
23
16
|
Testeranto(testInput, testSpecifications, testImplementations, {
|
|
24
17
|
beforeAll: async (input, artificer) => {
|
|
25
|
-
console.log("beforeAll", input);
|
|
26
18
|
return await new Promise((resolve, rej) => {
|
|
27
19
|
resolve(rootElement);
|
|
28
20
|
});
|
|
29
21
|
},
|
|
30
22
|
beforeEach: async (subject, ndx, testRsource, artificer) => {
|
|
31
23
|
return new Promise((resolve, rej) => {
|
|
32
|
-
console.log("beforeEach", subject);
|
|
33
24
|
createPortal(TesterantoComponent({
|
|
34
25
|
innerComp: testInput,
|
|
35
26
|
done: (reactElement) => {
|
|
36
27
|
process.nextTick(() => {
|
|
37
|
-
resolve(reactElement);
|
|
28
|
+
resolve(reactElement);
|
|
38
29
|
});
|
|
39
|
-
}
|
|
30
|
+
},
|
|
40
31
|
}), rootElement);
|
|
41
32
|
});
|
|
42
33
|
},
|
|
43
|
-
andWhen: function (s,
|
|
34
|
+
andWhen: function (s, whenCB) {
|
|
44
35
|
return new Promise((resolve, rej) => {
|
|
45
|
-
process.nextTick(() => {
|
|
36
|
+
process.nextTick(() => {
|
|
37
|
+
resolve(whenCB()(s));
|
|
38
|
+
});
|
|
46
39
|
});
|
|
47
40
|
},
|
|
48
41
|
butThen: async function (s) {
|
|
49
42
|
return new Promise((resolve, rej) => {
|
|
50
|
-
process.nextTick(() => {
|
|
43
|
+
process.nextTick(() => {
|
|
44
|
+
resolve(s);
|
|
45
|
+
});
|
|
51
46
|
});
|
|
52
47
|
},
|
|
53
48
|
afterEach: async function (store, ndx, artificer) {
|
|
54
49
|
return new Promise((resolve, rej) => {
|
|
55
|
-
process.nextTick(() => {
|
|
50
|
+
process.nextTick(() => {
|
|
51
|
+
resolve({});
|
|
52
|
+
});
|
|
56
53
|
});
|
|
57
54
|
},
|
|
58
55
|
afterAll: (store, artificer) => {
|
|
59
56
|
return new Promise((resolve, rej) => {
|
|
60
|
-
process.nextTick(() => {
|
|
57
|
+
process.nextTick(() => {
|
|
58
|
+
resolve({});
|
|
59
|
+
});
|
|
61
60
|
});
|
|
62
61
|
},
|
|
63
62
|
});
|
package/dist/module/{subPackages → SubPackages}/react-test-renderer/MemoExoticComponent/node.js
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import test from "../../../Node";
|
|
2
1
|
import React from "react";
|
|
3
2
|
import renderer, { act } from "react-test-renderer";
|
|
3
|
+
import test from "../../../Node";
|
|
4
4
|
export default (testImplementations, testSpecifications, testInput) => test(testInput, testSpecifications, testImplementations, {
|
|
5
5
|
beforeEach: function (CComponent, props) {
|
|
6
6
|
let component;
|
|
@@ -9,8 +9,8 @@ export default (testImplementations, testSpecifications, testInput) => test(test
|
|
|
9
9
|
});
|
|
10
10
|
return component;
|
|
11
11
|
},
|
|
12
|
-
andWhen: async function (renderer,
|
|
13
|
-
await act(() =>
|
|
12
|
+
andWhen: async function (renderer, whenCB) {
|
|
13
|
+
await act(() => whenCB()(renderer));
|
|
14
14
|
return renderer;
|
|
15
15
|
},
|
|
16
16
|
});
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import renderer, { act } from "react-test-renderer";
|
|
2
3
|
// export const testInterface = {
|
|
3
4
|
// beforeEach: function (CComponent, props): Promise<renderer.ReactTestRenderer> {
|
|
@@ -13,33 +14,39 @@ import renderer, { act } from "react-test-renderer";
|
|
|
13
14
|
// },
|
|
14
15
|
// andWhen: async function (
|
|
15
16
|
// renderer: renderer.ReactTestRenderer,
|
|
16
|
-
//
|
|
17
|
+
// whenCB: () => (any) => any
|
|
17
18
|
// ): Promise<renderer.ReactTestRenderer> {
|
|
18
|
-
// await act(() =>
|
|
19
|
+
// await act(() => whenCB()(renderer));
|
|
19
20
|
// return renderer
|
|
20
21
|
// }
|
|
21
22
|
// }
|
|
22
23
|
export const testInterface = {
|
|
23
|
-
beforeEach: function (CComponent,
|
|
24
|
+
beforeEach: function (CComponent, propsAndChildren) {
|
|
25
|
+
function Link(props) {
|
|
26
|
+
const p = props.props;
|
|
27
|
+
const c = props.children;
|
|
28
|
+
return React.createElement(CComponent, p, c);
|
|
29
|
+
}
|
|
24
30
|
return new Promise((res, rej) => {
|
|
25
|
-
act(() => {
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
31
|
+
act(async () => {
|
|
32
|
+
const p = propsAndChildren;
|
|
33
|
+
const y = new CComponent(p.props);
|
|
34
|
+
const testRenderer = await renderer.create(Link(propsAndChildren));
|
|
35
|
+
res(testRenderer);
|
|
29
36
|
});
|
|
30
37
|
});
|
|
31
38
|
},
|
|
32
|
-
andWhen: async function (renderer,
|
|
33
|
-
// console.log("andWhen",
|
|
34
|
-
await act(() =>
|
|
39
|
+
andWhen: async function (renderer, whenCB) {
|
|
40
|
+
// console.log("andWhen", whenCB)
|
|
41
|
+
await act(() => whenCB(renderer));
|
|
35
42
|
return renderer;
|
|
36
43
|
},
|
|
37
|
-
// andWhen: function (s: Store,
|
|
38
|
-
// return
|
|
44
|
+
// andWhen: function (s: Store, whenCB): Promise<Selection> {
|
|
45
|
+
// return whenCB()(s);
|
|
39
46
|
// },
|
|
40
|
-
butThen: async function (s) {
|
|
41
|
-
|
|
42
|
-
return s;
|
|
47
|
+
butThen: async function (s, thenCB, tr) {
|
|
48
|
+
console.log("butThen", thenCB.toString());
|
|
49
|
+
return thenCB(s);
|
|
43
50
|
},
|
|
44
51
|
afterEach: async function (store, ndx, artificer) {
|
|
45
52
|
// console.log("afterEach", store);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import Testeranto from "../../../Node";
|
|
2
|
-
import { testInterface } from ".";
|
|
1
|
+
import Testeranto from "../../../Node.js";
|
|
2
|
+
import { testInterface } from "./index.js";
|
|
3
3
|
export default (testImplementations, testSpecifications, testInput) => Testeranto(testInput, testSpecifications, testImplementations, testInterface);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import Testeranto from "../../../Web";
|
|
2
|
-
import { testInterface } from ".";
|
|
1
|
+
import Testeranto from "../../../Web.js";
|
|
2
|
+
import { testInterface } from "./index.js";
|
|
3
3
|
export default (testImplementations, testSpecifications, testInput) => Testeranto(testInput, testSpecifications, testImplementations, testInterface);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import test from "../../../Node";
|
|
2
1
|
import React from "react";
|
|
3
2
|
import renderer, { act } from "react-test-renderer";
|
|
3
|
+
import test from "../../../Node.js";
|
|
4
4
|
export default (testImplementations, testSpecifications, testInput) => test(testInput, testSpecifications, testImplementations, {
|
|
5
5
|
beforeEach: function (CComponent, props) {
|
|
6
6
|
return new Promise((res, rej) => {
|
|
@@ -11,8 +11,8 @@ export default (testImplementations, testSpecifications, testInput) => test(test
|
|
|
11
11
|
});
|
|
12
12
|
});
|
|
13
13
|
},
|
|
14
|
-
andWhen: async function (renderer,
|
|
15
|
-
await act(() =>
|
|
14
|
+
andWhen: async function (renderer, whenCB) {
|
|
15
|
+
await act(() => whenCB()(renderer));
|
|
16
16
|
return renderer;
|
|
17
17
|
},
|
|
18
18
|
afterEach: async (store, key, artificer) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import test from "../../../Web";
|
|
2
1
|
import React from "react";
|
|
3
2
|
import renderer, { act } from "react-test-renderer";
|
|
3
|
+
import test from "../../../Web.js";
|
|
4
4
|
export default (testImplementations, testSpecifications, testInput) => test(testInput, testSpecifications, testImplementations, {
|
|
5
5
|
beforeEach: function (CComponent, props) {
|
|
6
6
|
return new Promise((res, rej) => {
|
|
@@ -11,8 +11,8 @@ export default (testImplementations, testSpecifications, testInput) => test(test
|
|
|
11
11
|
});
|
|
12
12
|
});
|
|
13
13
|
},
|
|
14
|
-
andWhen: async function (renderer,
|
|
15
|
-
await act(() =>
|
|
14
|
+
andWhen: async function (renderer, whenCB) {
|
|
15
|
+
await act(() => whenCB()(renderer));
|
|
16
16
|
return renderer;
|
|
17
17
|
},
|
|
18
18
|
afterEach: async (store, key, artificer) => {
|
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import renderer, { act } from "react-test-renderer";
|
|
3
3
|
export const testInterface = {
|
|
4
|
+
butThen: async function (s, thenCB, tr) {
|
|
5
|
+
console.log("butThen", thenCB.toString());
|
|
6
|
+
return thenCB(s);
|
|
7
|
+
},
|
|
4
8
|
beforeEach: function (CComponent, props) {
|
|
9
|
+
console.log("ASDASDx");
|
|
5
10
|
let component;
|
|
6
11
|
act(() => {
|
|
7
12
|
component = renderer.create(React.createElement(CComponent, props, []));
|
|
8
13
|
});
|
|
9
14
|
return component;
|
|
10
15
|
},
|
|
11
|
-
andWhen: async function (renderer,
|
|
12
|
-
await act(() =>
|
|
16
|
+
andWhen: async function (renderer, whenCB) {
|
|
17
|
+
await act(() => whenCB(renderer));
|
|
13
18
|
return renderer;
|
|
14
|
-
}
|
|
19
|
+
},
|
|
15
20
|
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import test from "../../../Node.js";
|
|
2
|
+
import { testInterface } from "./index.js";
|
|
3
|
+
export default (testImplementations, testSpecifications, testInput, testInterface2 = testInterface) => {
|
|
4
|
+
return test(testInput, testSpecifications, testImplementations, testInterface2);
|
|
5
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import test from "../../../Web.js";
|
|
2
|
+
import { testInterface } from "./index.js";
|
|
3
|
+
export default (testImplementations, testSpecifications, testInput, testInterface2 = testInterface) => {
|
|
4
|
+
return test(testInput, testSpecifications, testImplementations, testInterface2);
|
|
5
|
+
};
|
|
@@ -9,8 +9,8 @@ export const testInterface = {
|
|
|
9
9
|
res(component);
|
|
10
10
|
});
|
|
11
11
|
},
|
|
12
|
-
andWhen: async function (renderer,
|
|
13
|
-
await act(() =>
|
|
12
|
+
andWhen: async function (renderer, whenCB) {
|
|
13
|
+
await act(() => whenCB()(renderer));
|
|
14
14
|
return renderer;
|
|
15
|
-
}
|
|
15
|
+
},
|
|
16
16
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { testInterface } from ".";
|
|
1
2
|
import test from "../../../Node";
|
|
2
|
-
import { testInterface } from "./index";
|
|
3
3
|
export default (testImplementations, testSpecifications, testInput) => {
|
|
4
4
|
return test(testInput, testSpecifications, testImplementations, testInterface);
|
|
5
5
|
};
|
package/dist/module/Types.js
CHANGED
package/dist/module/Web.js
CHANGED
|
@@ -1,118 +1,54 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
webSocket.send(JSON.stringify({
|
|
20
|
-
type: "testeranto:adios",
|
|
21
|
-
data: {
|
|
22
|
-
failed,
|
|
23
|
-
testResourceConfiguration: t.test.testResourceConfiguration,
|
|
24
|
-
results: t.toObj(),
|
|
25
|
-
},
|
|
26
|
-
}));
|
|
27
|
-
Promise.all([...artifacts, logPromise]).then(async () => {
|
|
28
|
-
// ipcRenderer.invoke('quit-app', failed);
|
|
29
|
-
window.exit(failed);
|
|
30
|
-
});
|
|
31
|
-
};
|
|
32
|
-
export default async (input, testSpecification, testImplementation, testInterface, testResourceRequirement = defaultTestResourceRequirement) => {
|
|
33
|
-
console.log("web NodeWriter", window.NodeWriter);
|
|
34
|
-
const mrt = new TesterantoLevelTwo(input, testSpecification, testImplementation, testInterface, testResourceRequirement, testInterface.assertioner || (async (t) => t), testInterface.beforeEach ||
|
|
35
|
-
async function (subject, initialValues, testResource) {
|
|
36
|
-
return subject;
|
|
37
|
-
}, testInterface.afterEach || (async (s) => s), testInterface.afterAll || ((store) => undefined), testInterface.butThen || (async (a) => a), testInterface.andWhen, testInterface.actionHandler ||
|
|
38
|
-
function (b) {
|
|
39
|
-
return b;
|
|
40
|
-
}, window.NodeWriter);
|
|
41
|
-
const tl2 = mrt;
|
|
42
|
-
const t = tl2.testJobs[0];
|
|
43
|
-
const testResourceArg = decodeURIComponent(new URLSearchParams(location.search).get('requesting') || '');
|
|
44
|
-
try {
|
|
45
|
-
const partialTestResource = JSON.parse(testResourceArg);
|
|
46
|
-
console.log("initial test resource", partialTestResource);
|
|
47
|
-
if (partialTestResource.scheduled) {
|
|
48
|
-
console.log("test is scheduled");
|
|
49
|
-
console.log("awaiting test resources via WS...");
|
|
50
|
-
webSocket.addEventListener("open", (event) => {
|
|
51
|
-
webSocket.addEventListener("message", (event) => {
|
|
52
|
-
console.log("Message from server ", event.data);
|
|
53
|
-
});
|
|
54
|
-
const r = JSON.stringify({
|
|
55
|
-
type: "testeranto:hola",
|
|
56
|
-
data: {
|
|
57
|
-
requirement: Object.assign(Object.assign({}, testResourceRequirement), { name: partialTestResource.name })
|
|
58
|
-
},
|
|
59
|
-
});
|
|
60
|
-
webSocket.send(r);
|
|
61
|
-
console.log("awaiting test resources via websocket...", r);
|
|
62
|
-
webSocket.onmessage = (async (msg) => {
|
|
63
|
-
console.log("message: ", msg);
|
|
64
|
-
const resourcesFromWs = JSON.parse(msg.data);
|
|
65
|
-
console.log("secondary test resource", resourcesFromWs);
|
|
66
|
-
const secondTestResource = Object.assign(Object.assign({ fs: "." }, JSON.parse(JSON.stringify(partialTestResource))), JSON.parse(JSON.stringify(resourcesFromWs)));
|
|
67
|
-
console.log("final test resource", secondTestResource);
|
|
68
|
-
receiveTestResourceConfigScheduled(t, secondTestResource);
|
|
69
|
-
});
|
|
70
|
-
});
|
|
1
|
+
import Testeranto from "./lib/core.js";
|
|
2
|
+
import { defaultTestResourceRequirement, } from "./lib/index.js";
|
|
3
|
+
// const remote = require("@electron/remote");
|
|
4
|
+
// import remote from "@electron/remote";
|
|
5
|
+
// const electron = require("electron");
|
|
6
|
+
// const remote =
|
|
7
|
+
// process.type === "browser" ? electron : require("@electron/remote");
|
|
8
|
+
class WebTesteranto extends Testeranto {
|
|
9
|
+
constructor(input, testSpecification, testImplementation, testResourceRequirement, testInterface) {
|
|
10
|
+
super(input, testSpecification, testImplementation, testResourceRequirement, window.NodeWriter, testInterface);
|
|
11
|
+
const testResourceArg = decodeURIComponent(new URLSearchParams(location.search).get("requesting") || "");
|
|
12
|
+
try {
|
|
13
|
+
const partialTestResource = JSON.parse(testResourceArg);
|
|
14
|
+
this.receiveTestResourceConfig(this.testJobs[0], partialTestResource);
|
|
15
|
+
}
|
|
16
|
+
catch (e) {
|
|
17
|
+
console.error(e);
|
|
18
|
+
// process.exit(-1);
|
|
71
19
|
}
|
|
72
|
-
|
|
73
|
-
|
|
20
|
+
const requesting = new URLSearchParams(location.search).get("requesting");
|
|
21
|
+
if (requesting) {
|
|
22
|
+
const testResourceArg = decodeURIComponent(requesting);
|
|
23
|
+
try {
|
|
24
|
+
const partialTestResource = JSON.parse(testResourceArg);
|
|
25
|
+
console.log("initial test resource", partialTestResource);
|
|
26
|
+
this.receiveTestResourceConfig(this.testJobs[0], partialTestResource);
|
|
27
|
+
}
|
|
28
|
+
catch (e) {
|
|
29
|
+
console.error(e);
|
|
30
|
+
// process.exit(-1);
|
|
31
|
+
}
|
|
74
32
|
}
|
|
75
|
-
// const partialTestResource = JSON.parse(
|
|
76
|
-
// testResourceArg
|
|
77
|
-
// ) as ITTestResourceConfiguration;
|
|
78
|
-
// if (partialTestResource.fs && partialTestResource.ports) {
|
|
79
|
-
// receiveTestResourceConfig(t, partialTestResource);
|
|
80
|
-
// } else {
|
|
81
|
-
// console.log("test configuration is incomplete", partialTestResource);
|
|
82
|
-
// console.log(
|
|
83
|
-
// "requesting test resources via ws",
|
|
84
|
-
// testResourceRequirement
|
|
85
|
-
// );
|
|
86
|
-
// webSocket.addEventListener("open", (event) => {
|
|
87
|
-
// webSocket.addEventListener("message", (event) => {
|
|
88
|
-
// console.log("Message from server ", event.data);
|
|
89
|
-
// });
|
|
90
|
-
// const r = JSON.stringify({
|
|
91
|
-
// type: "testeranto:hola",
|
|
92
|
-
// data: {
|
|
93
|
-
// testResourceRequirement,
|
|
94
|
-
// },
|
|
95
|
-
// });
|
|
96
|
-
// webSocket.send(r);
|
|
97
|
-
// console.log("awaiting test resources via websocket...", r);
|
|
98
|
-
// webSocket.onmessage = (
|
|
99
|
-
// async (msg: MessageEvent<any>) => {
|
|
100
|
-
// console.log("message: ", msg);
|
|
101
|
-
// const resourcesFromPm2 = msg.data.testResourceConfiguration;
|
|
102
|
-
// const secondTestResource = {
|
|
103
|
-
// fs: ".",
|
|
104
|
-
// ...JSON.parse(JSON.stringify(partialTestResource)),
|
|
105
|
-
// ...JSON.parse(JSON.stringify(resourcesFromPm2)),
|
|
106
|
-
// } as ITTestResourceConfiguration;
|
|
107
|
-
// console.log("secondTestResource", secondTestResource);
|
|
108
|
-
// receiveTestResourceConfig(t, secondTestResource);
|
|
109
|
-
// }
|
|
110
|
-
// );
|
|
111
|
-
// });
|
|
112
|
-
// }
|
|
113
33
|
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
34
|
+
async receiveTestResourceConfig(t, partialTestResource) {
|
|
35
|
+
const { failed, artifacts, logPromise } = await t.receiveTestResourceConfig(partialTestResource, {
|
|
36
|
+
browser: await window.browser,
|
|
37
|
+
ipc: window.ipcRenderer,
|
|
38
|
+
});
|
|
39
|
+
console.log("test is done, awaiting test result write to fs");
|
|
40
|
+
Promise.all([...artifacts, logPromise]).then(async () => {
|
|
41
|
+
// we can't close the window becuase we might be taking a screenshot
|
|
42
|
+
// window.close();
|
|
43
|
+
// console.log(
|
|
44
|
+
// "(window as any).browser",
|
|
45
|
+
// JSON.stringify(await (window as any).browser)
|
|
46
|
+
// );
|
|
47
|
+
// var currentWindow = (await (window as any).browser).getCurrentWindow();
|
|
48
|
+
// currentWindow.close();
|
|
49
|
+
});
|
|
117
50
|
}
|
|
51
|
+
}
|
|
52
|
+
export default async (input, testSpecification, testImplementation, testInterface, testResourceRequirement = defaultTestResourceRequirement) => {
|
|
53
|
+
return new WebTesteranto(input, testSpecification, testImplementation, testResourceRequirement, testInterface);
|
|
118
54
|
};
|