testeranto 0.110.0 → 0.111.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/package.json +1 -1
- package/src/PM/main.ts +418 -92
- package/src/ReportClient.tsx +38 -30
- package/src/run.ts +4 -371
- package/tsc.log +8 -6
- package/dist/common/Init.js +0 -68
- package/dist/common/Node.js +0 -27
- package/dist/common/PM/index.js +0 -7
- package/dist/common/PM/main.js +0 -984
- package/dist/common/PM/node.js +0 -128
- package/dist/common/PM/web.js +0 -121
- package/dist/common/ReportServer.js +0 -22
- package/dist/common/SubPackages/react/component/node.js +0 -19
- package/dist/common/SubPackages/react/component/web.js +0 -19
- package/dist/common/SubPackages/react/jsx/index.js +0 -21
- package/dist/common/SubPackages/react/jsx/node.js +0 -10
- package/dist/common/SubPackages/react/jsx/web.js +0 -10
- package/dist/common/SubPackages/react-dom/component/node.js +0 -88
- package/dist/common/SubPackages/react-dom/component/web.js +0 -67
- package/dist/common/SubPackages/react-dom/jsx/index.js +0 -2
- package/dist/common/SubPackages/react-dom/jsx/node.js +0 -39
- package/dist/common/SubPackages/react-dom/jsx/web.js +0 -128
- package/dist/common/SubPackages/react-test-renderer/MemoExoticComponent/node.js +0 -54
- package/dist/common/SubPackages/react-test-renderer/component/index.js +0 -2
- package/dist/common/SubPackages/react-test-renderer/component/interface.js +0 -70
- 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/common/SubPackages/react-test-renderer/fc/node.js +0 -60
- package/dist/common/SubPackages/react-test-renderer/fc/web.js +0 -60
- package/dist/common/SubPackages/react-test-renderer/jsx/index.js +0 -67
- package/dist/common/SubPackages/react-test-renderer/jsx/node.js +0 -10
- package/dist/common/SubPackages/react-test-renderer/jsx/web.js +0 -10
- package/dist/common/SubPackages/react-test-renderer/jsx-promised/index.js +0 -52
- package/dist/common/SubPackages/react-test-renderer/jsx-promised/node.js +0 -10
- package/dist/common/SubPackages/react-test-renderer/jsx-promised/web.js +0 -10
- package/dist/common/Types.js +0 -2
- package/dist/common/Web.js +0 -49
- package/dist/common/build.js +0 -222
- package/dist/common/defaultConfig.js +0 -20
- package/dist/common/esbuildConfigs/eslint-formatter-testeranto.js +0 -6
- package/dist/common/esbuildConfigs/featuresPlugin.js +0 -39
- package/dist/common/esbuildConfigs/index.js +0 -21
- package/dist/common/esbuildConfigs/inputFilesPlugin.js +0 -27
- package/dist/common/esbuildConfigs/node.js +0 -37
- package/dist/common/esbuildConfigs/web.js +0 -50
- package/dist/common/init-docs.js +0 -53
- package/dist/common/lib/abstractBase.js +0 -329
- package/dist/common/lib/basebuilder.js +0 -98
- package/dist/common/lib/classBuilder.js +0 -40
- package/dist/common/lib/core.js +0 -117
- package/dist/common/lib/index.js +0 -21
- package/dist/common/lib/types.js +0 -2
- package/dist/common/package.json +0 -3
- package/dist/common/puppeteerConfiger.js +0 -24
- package/dist/common/run.js +0 -297
- package/dist/common/tsconfig.common.tsbuildinfo +0 -1
- package/dist/common/utils.js +0 -43
- package/dist/common/web.html.js +0 -22
- package/dist/module/Footer.js +0 -4
- package/dist/module/Init.js +0 -63
- package/dist/module/Node.js +0 -20
- package/dist/module/PM/index.js +0 -3
- package/dist/module/PM/main.js +0 -944
- package/dist/module/PM/node.js +0 -121
- package/dist/module/PM/web.js +0 -117
- package/dist/module/ReportClient.js +0 -97
- package/dist/module/ReportServer.js +0 -17
- package/dist/module/SubPackages/react/component/node.js +0 -14
- package/dist/module/SubPackages/react/component/web.js +0 -14
- package/dist/module/SubPackages/react/jsx/index.js +0 -15
- 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/component/node.js +0 -80
- package/dist/module/SubPackages/react-dom/component/web.js +0 -62
- package/dist/module/SubPackages/react-dom/jsx/index.js +0 -1
- package/dist/module/SubPackages/react-dom/jsx/node.js +0 -31
- package/dist/module/SubPackages/react-dom/jsx/web.js +0 -90
- package/dist/module/SubPackages/react-test-renderer/MemoExoticComponent/node.js +0 -16
- package/dist/module/SubPackages/react-test-renderer/component/index.js +0 -1
- package/dist/module/SubPackages/react-test-renderer/component/interface.js +0 -31
- package/dist/module/SubPackages/react-test-renderer/component/node.js +0 -3
- package/dist/module/SubPackages/react-test-renderer/component/web.js +0 -3
- package/dist/module/SubPackages/react-test-renderer/fc/node.js +0 -22
- package/dist/module/SubPackages/react-test-renderer/fc/web.js +0 -22
- package/dist/module/SubPackages/react-test-renderer/jsx/index.js +0 -28
- package/dist/module/SubPackages/react-test-renderer/jsx/node.js +0 -5
- package/dist/module/SubPackages/react-test-renderer/jsx/web.js +0 -5
- package/dist/module/SubPackages/react-test-renderer/jsx-promised/index.js +0 -16
- package/dist/module/SubPackages/react-test-renderer/jsx-promised/node.js +0 -5
- package/dist/module/SubPackages/react-test-renderer/jsx-promised/web.js +0 -5
- package/dist/module/TestReport.js +0 -91
- package/dist/module/Types.js +0 -1
- package/dist/module/Web.js +0 -42
- package/dist/module/build.js +0 -184
- package/dist/module/defaultConfig.js +0 -18
- package/dist/module/esbuildConfigs/eslint-formatter-testeranto.js +0 -3
- package/dist/module/esbuildConfigs/featuresPlugin.js +0 -34
- package/dist/module/esbuildConfigs/index.js +0 -19
- package/dist/module/esbuildConfigs/inputFilesPlugin.js +0 -22
- package/dist/module/esbuildConfigs/node.js +0 -32
- package/dist/module/esbuildConfigs/web.js +0 -45
- package/dist/module/init-docs.js +0 -15
- package/dist/module/lib/abstractBase.js +0 -321
- package/dist/module/lib/basebuilder.js +0 -94
- package/dist/module/lib/classBuilder.js +0 -36
- package/dist/module/lib/core.js +0 -114
- package/dist/module/lib/index.js +0 -17
- package/dist/module/lib/types.js +0 -1
- package/dist/module/package.json +0 -3
- package/dist/module/puppeteerConfiger.js +0 -19
- package/dist/module/run.js +0 -259
- package/dist/module/tsconfig.module.tsbuildinfo +0 -1
- package/dist/module/utils.js +0 -29
- package/dist/module/web.html.js +0 -20
- package/dist/prebuild/ReportClient.css +0 -11367
- package/dist/prebuild/ReportClient.js +0 -23641
- package/dist/prebuild/ReportServer.mjs +0 -16
- package/dist/prebuild/TestReport.css +0 -11367
- package/dist/prebuild/TestReport.js +0 -27484
- package/dist/prebuild/build.mjs +0 -376
- package/dist/prebuild/esbuildConfigs/eslint-formatter-testeranto.mjs +0 -9
- package/dist/prebuild/init-docs.mjs +0 -104
- package/dist/prebuild/run.mjs +0 -1190
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/dist/types/Init.d.ts +0 -2
- package/dist/types/Node.d.ts +0 -12
- package/dist/types/PM/index.d.ts +0 -34
- package/dist/types/PM/main.d.ts +0 -59
- package/dist/types/PM/node.d.ts +0 -40
- package/dist/types/PM/web.d.ts +0 -38
- package/dist/types/ReportServer.d.ts +0 -1
- package/dist/types/SubPackages/react/component/node.d.ts +0 -7
- package/dist/types/SubPackages/react/component/web.d.ts +0 -7
- package/dist/types/SubPackages/react/jsx/index.d.ts +0 -12
- 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 -11
- package/dist/types/SubPackages/react-dom/component/web.d.ts +0 -20
- package/dist/types/SubPackages/react-dom/jsx/index.d.ts +0 -6
- package/dist/types/SubPackages/react-dom/jsx/node.d.ts +0 -7
- package/dist/types/SubPackages/react-dom/jsx/web.d.ts +0 -5
- package/dist/types/SubPackages/react-test-renderer/MemoExoticComponent/node.d.ts +0 -6
- package/dist/types/SubPackages/react-test-renderer/component/index.d.ts +0 -13
- package/dist/types/SubPackages/react-test-renderer/component/interface.d.ts +0 -9
- package/dist/types/SubPackages/react-test-renderer/component/node.d.ts +0 -4
- package/dist/types/SubPackages/react-test-renderer/component/web.d.ts +0 -4
- package/dist/types/SubPackages/react-test-renderer/fc/node.d.ts +0 -8
- package/dist/types/SubPackages/react-test-renderer/fc/web.d.ts +0 -9
- package/dist/types/SubPackages/react-test-renderer/jsx/index.d.ts +0 -16
- package/dist/types/SubPackages/react-test-renderer/jsx/node.d.ts +0 -9
- package/dist/types/SubPackages/react-test-renderer/jsx/web.d.ts +0 -9
- package/dist/types/SubPackages/react-test-renderer/jsx-promised/index.d.ts +0 -15
- package/dist/types/SubPackages/react-test-renderer/jsx-promised/node.d.ts +0 -5
- package/dist/types/SubPackages/react-test-renderer/jsx-promised/web.d.ts +0 -5
- package/dist/types/Types.d.ts +0 -61
- package/dist/types/Web.d.ts +0 -9
- package/dist/types/build.d.ts +0 -1
- package/dist/types/defaultConfig.d.ts +0 -3
- package/dist/types/esbuildConfigs/eslint-formatter-testeranto.d.ts +0 -2
- package/dist/types/esbuildConfigs/featuresPlugin.d.ts +0 -5
- package/dist/types/esbuildConfigs/index.d.ts +0 -4
- package/dist/types/esbuildConfigs/inputFilesPlugin.d.ts +0 -6
- package/dist/types/esbuildConfigs/node.d.ts +0 -4
- package/dist/types/esbuildConfigs/web.d.ts +0 -4
- package/dist/types/init-docs.d.ts +0 -1
- package/dist/types/lib/abstractBase.d.ts +0 -110
- package/dist/types/lib/basebuilder.d.ts +0 -27
- package/dist/types/lib/classBuilder.d.ts +0 -7
- package/dist/types/lib/core.d.ts +0 -7
- package/dist/types/lib/index.d.ts +0 -83
- package/dist/types/lib/types.d.ts +0 -14
- package/dist/types/puppeteerConfiger.d.ts +0 -4
- package/dist/types/run.d.ts +0 -1
- package/dist/types/tsconfig.types.tsbuildinfo +0 -1
- package/dist/types/utils.d.ts +0 -9
- package/dist/types/web.html.d.ts +0 -2
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import React, { useEffect, useRef } from "react";
|
|
2
|
-
import { createElement } from "react";
|
|
3
|
-
import ReactDom from "react-dom";
|
|
4
|
-
import Testeranto from "../../../Web.js";
|
|
5
|
-
const TesterantoComponent = ({ done, innerComp, }) => {
|
|
6
|
-
const myContainer = useRef(null);
|
|
7
|
-
useEffect(() => {
|
|
8
|
-
console.log("useEffect called!", myContainer.current);
|
|
9
|
-
done(myContainer.current);
|
|
10
|
-
}, []);
|
|
11
|
-
return React.createElement("div", { ref: myContainer }, innerComp());
|
|
12
|
-
};
|
|
13
|
-
export default (testImplementations, testSpecifications, testInput) => {
|
|
14
|
-
const t = Testeranto(testInput, testSpecifications, testImplementations, {
|
|
15
|
-
beforeAll: async (reactElement, itr) => {
|
|
16
|
-
return await new Promise((resolve, rej) => {
|
|
17
|
-
const htmlElement = document.getElementById("root");
|
|
18
|
-
if (htmlElement) {
|
|
19
|
-
const domRoot = ReactDom.createRoot(htmlElement);
|
|
20
|
-
domRoot.render(createElement(TesterantoComponent, {
|
|
21
|
-
// ...initialProps,
|
|
22
|
-
innerComp: reactElement,
|
|
23
|
-
done: (reactElement) => {
|
|
24
|
-
resolve({
|
|
25
|
-
htmlElement,
|
|
26
|
-
reactElement,
|
|
27
|
-
domRoot,
|
|
28
|
-
});
|
|
29
|
-
},
|
|
30
|
-
}, []));
|
|
31
|
-
// resolve({ htmlElement });
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
},
|
|
35
|
-
beforeEach: async (subject) => {
|
|
36
|
-
return subject;
|
|
37
|
-
// return new Promise((resolve, rej) => {
|
|
38
|
-
// resolve(subject);
|
|
39
|
-
// // const tc = TesterantoComponent({
|
|
40
|
-
// // innerComp: () =>
|
|
41
|
-
// // testInput({
|
|
42
|
-
// // port: 3003,
|
|
43
|
-
// // address: "some-address",
|
|
44
|
-
// // secretKey: "someSecretKey",
|
|
45
|
-
// // abi: "foo",
|
|
46
|
-
// // }),
|
|
47
|
-
// // done: (reactElement: any) => {
|
|
48
|
-
// // console.log("mark9");
|
|
49
|
-
// // resolve(reactElement);
|
|
50
|
-
// // // process.nextTick(() => {
|
|
51
|
-
// // // resolve(reactElement);
|
|
52
|
-
// // // });
|
|
53
|
-
// // },
|
|
54
|
-
// // });
|
|
55
|
-
// // console.log("mark9", tc);
|
|
56
|
-
// // createPortal(tc, subject.domRoot);
|
|
57
|
-
// });
|
|
58
|
-
},
|
|
59
|
-
andWhen: async function (s, whenCB, tr, utils) {
|
|
60
|
-
return whenCB(s, utils);
|
|
61
|
-
// return new Promise(async (resolve, rej) => {
|
|
62
|
-
// // resolve(await whenCB(s, utils));
|
|
63
|
-
// // process.nextTick(() => {
|
|
64
|
-
// // resolve(whenCB()(s));
|
|
65
|
-
// // });
|
|
66
|
-
// });
|
|
67
|
-
},
|
|
68
|
-
butThen: async function (s, thenCB, tr, utils) {
|
|
69
|
-
return new Promise((resolve, rej) => {
|
|
70
|
-
resolve(thenCB(s, utils));
|
|
71
|
-
});
|
|
72
|
-
},
|
|
73
|
-
afterEach: async function (store, ndx, artificer) {
|
|
74
|
-
return new Promise((resolve, rej) => {
|
|
75
|
-
resolve({});
|
|
76
|
-
});
|
|
77
|
-
},
|
|
78
|
-
afterAll: (store, artificer) => {
|
|
79
|
-
return new Promise((resolve, rej) => {
|
|
80
|
-
resolve({});
|
|
81
|
-
});
|
|
82
|
-
},
|
|
83
|
-
});
|
|
84
|
-
document.addEventListener("DOMContentLoaded", function () {
|
|
85
|
-
const rootElement = document.getElementById("root");
|
|
86
|
-
if (rootElement) {
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
return t;
|
|
90
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import renderer, { act } from "react-test-renderer";
|
|
3
|
-
import test from "../../../Node";
|
|
4
|
-
export default (testImplementations, testSpecifications, testInput) => test(testInput, testSpecifications, testImplementations, {
|
|
5
|
-
beforeEach: function (CComponent, props) {
|
|
6
|
-
let component;
|
|
7
|
-
act(() => {
|
|
8
|
-
component = renderer.create(React.createElement(CComponent, props, []));
|
|
9
|
-
});
|
|
10
|
-
return component;
|
|
11
|
-
},
|
|
12
|
-
andWhen: async function (renderer, whenCB) {
|
|
13
|
-
await act(() => whenCB()(renderer));
|
|
14
|
-
return renderer;
|
|
15
|
-
},
|
|
16
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import renderer, { act } from "react-test-renderer";
|
|
3
|
-
export const testInterface = {
|
|
4
|
-
beforeEach: function (CComponent, propsAndChildren) {
|
|
5
|
-
function Link(proper) {
|
|
6
|
-
return React.createElement(CComponent, proper(), []);
|
|
7
|
-
}
|
|
8
|
-
return new Promise((res, rej) => {
|
|
9
|
-
act(async () => {
|
|
10
|
-
const testRenderer = await renderer.create(Link(propsAndChildren));
|
|
11
|
-
res(testRenderer);
|
|
12
|
-
});
|
|
13
|
-
});
|
|
14
|
-
},
|
|
15
|
-
andWhen: async function (renderer, whenCB) {
|
|
16
|
-
await act(() => whenCB(renderer));
|
|
17
|
-
return renderer;
|
|
18
|
-
},
|
|
19
|
-
// andWhen: function (s: Store, whenCB): Promise<Selection> {
|
|
20
|
-
// return whenCB()(s);
|
|
21
|
-
// },
|
|
22
|
-
butThen: async function (s, thenCB, tr) {
|
|
23
|
-
return thenCB(s);
|
|
24
|
-
},
|
|
25
|
-
afterEach: async function (store, ndx, artificer) {
|
|
26
|
-
return {};
|
|
27
|
-
},
|
|
28
|
-
afterAll: (store, artificer) => {
|
|
29
|
-
return;
|
|
30
|
-
},
|
|
31
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import renderer, { act } from "react-test-renderer";
|
|
3
|
-
import test from "../../../Node.js";
|
|
4
|
-
export default (testImplementations, testSpecifications, testInput) => test(testInput, testSpecifications, testImplementations, {
|
|
5
|
-
beforeEach: function (CComponent, props) {
|
|
6
|
-
return new Promise((res, rej) => {
|
|
7
|
-
let component;
|
|
8
|
-
act(() => {
|
|
9
|
-
component = renderer.create(React.createElement(CComponent, props, []));
|
|
10
|
-
res(component);
|
|
11
|
-
});
|
|
12
|
-
});
|
|
13
|
-
},
|
|
14
|
-
andWhen: async function (renderer, whenCB) {
|
|
15
|
-
await act(() => whenCB()(renderer));
|
|
16
|
-
return renderer;
|
|
17
|
-
},
|
|
18
|
-
afterEach: async (store, key, artificer) => {
|
|
19
|
-
console.log("afterall");
|
|
20
|
-
store.unmount();
|
|
21
|
-
},
|
|
22
|
-
});
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import renderer, { act } from "react-test-renderer";
|
|
3
|
-
import test from "../../../Web.js";
|
|
4
|
-
export default (testImplementations, testSpecifications, testInput) => test(testInput, testSpecifications, testImplementations, {
|
|
5
|
-
beforeEach: function (CComponent, props) {
|
|
6
|
-
return new Promise((res, rej) => {
|
|
7
|
-
let component;
|
|
8
|
-
act(() => {
|
|
9
|
-
component = renderer.create(React.createElement(CComponent, props, []));
|
|
10
|
-
res(component);
|
|
11
|
-
});
|
|
12
|
-
});
|
|
13
|
-
},
|
|
14
|
-
andWhen: async function (renderer, whenCB) {
|
|
15
|
-
await act(() => whenCB()(renderer));
|
|
16
|
-
return renderer;
|
|
17
|
-
},
|
|
18
|
-
afterEach: async (store, key, artificer) => {
|
|
19
|
-
console.log("afterall");
|
|
20
|
-
store.unmount();
|
|
21
|
-
},
|
|
22
|
-
});
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import renderer, { act } from "react-test-renderer";
|
|
3
|
-
export const testInterface = {
|
|
4
|
-
butThen: async function (s, thenCB) {
|
|
5
|
-
// console.log("butThen", thenCB.toString());
|
|
6
|
-
return thenCB(s);
|
|
7
|
-
},
|
|
8
|
-
beforeEach: function (CComponent, props) {
|
|
9
|
-
let component;
|
|
10
|
-
act(() => {
|
|
11
|
-
// component = renderer.create(
|
|
12
|
-
// React.createElement(
|
|
13
|
-
// AppContext.Provider,
|
|
14
|
-
// { value: contextValue },
|
|
15
|
-
// React.createElement(AppContext.Consumer, null, (context) =>
|
|
16
|
-
// React.createElement(CComponent, Object.assign({}, context, {}))
|
|
17
|
-
// )
|
|
18
|
-
// )
|
|
19
|
-
// );
|
|
20
|
-
component = renderer.create(React.createElement(CComponent, props, React.createElement(CComponent, props, [])));
|
|
21
|
-
});
|
|
22
|
-
return component;
|
|
23
|
-
},
|
|
24
|
-
andWhen: async function (renderer, whenCB) {
|
|
25
|
-
await act(() => whenCB(renderer));
|
|
26
|
-
return renderer;
|
|
27
|
-
},
|
|
28
|
-
};
|
|
@@ -1,5 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,5 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import renderer, { act } from "react-test-renderer";
|
|
2
|
-
export const testInterface = {
|
|
3
|
-
beforeEach: async (CComponent) => {
|
|
4
|
-
return new Promise((res, rej) => {
|
|
5
|
-
let component;
|
|
6
|
-
act(async () => {
|
|
7
|
-
component = renderer.create(CComponent);
|
|
8
|
-
});
|
|
9
|
-
res(component);
|
|
10
|
-
});
|
|
11
|
-
},
|
|
12
|
-
andWhen: async function (renderer, whenCB) {
|
|
13
|
-
await act(() => whenCB()(renderer));
|
|
14
|
-
return renderer;
|
|
15
|
-
},
|
|
16
|
-
};
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import ReactDom from "react-dom/client";
|
|
2
|
-
import React, { useEffect, useState } from "react";
|
|
3
|
-
import { Col, Nav, Row, Tab } from "react-bootstrap";
|
|
4
|
-
import 'bootstrap/dist/css/bootstrap.min.css';
|
|
5
|
-
import "./style.css";
|
|
6
|
-
import { Footer } from "./Footer";
|
|
7
|
-
const StepPane = ({ step }) => {
|
|
8
|
-
return React.createElement("div", null,
|
|
9
|
-
React.createElement("pre", null,
|
|
10
|
-
React.createElement("code", null, JSON.stringify(step, null, 2))));
|
|
11
|
-
};
|
|
12
|
-
const TestPane = ({ given }) => {
|
|
13
|
-
return React.createElement("div", null,
|
|
14
|
-
" ",
|
|
15
|
-
React.createElement(Tab.Container, { id: "TestPane-tabs", defaultActiveKey: "first" },
|
|
16
|
-
React.createElement(Row, null,
|
|
17
|
-
React.createElement(Col, { sm: 3 },
|
|
18
|
-
React.createElement(Nav, { variant: "pills", className: "flex-column" },
|
|
19
|
-
React.createElement(Nav.Item, null,
|
|
20
|
-
React.createElement(Nav.Link, { eventKey: `bdd-features` }, "features"),
|
|
21
|
-
...given.whens.map((w, ndx) => React.createElement(Nav.Link, { eventKey: `bdd-when-${ndx}` },
|
|
22
|
-
"When ",
|
|
23
|
-
w.name,
|
|
24
|
-
" ",
|
|
25
|
-
w.error && "!")),
|
|
26
|
-
...given.thens.map((t, ndx) => React.createElement(Nav.Link, { eventKey: `bdd-then-${ndx}` },
|
|
27
|
-
"Then ",
|
|
28
|
-
t.name,
|
|
29
|
-
" ",
|
|
30
|
-
t.error && "!")),
|
|
31
|
-
React.createElement(Nav.Link, { eventKey: `bdd-errors` }, "errors")))),
|
|
32
|
-
React.createElement(Col, { sm: 9 },
|
|
33
|
-
React.createElement(Tab.Content, null,
|
|
34
|
-
React.createElement(Tab.Pane, { eventKey: `bdd-features` },
|
|
35
|
-
React.createElement("pre", null,
|
|
36
|
-
React.createElement("code", null, JSON.stringify(given.features, null, 2)))),
|
|
37
|
-
...given.whens.map((w, ndx) => React.createElement(Tab.Pane, { eventKey: `bdd-when-${ndx}` },
|
|
38
|
-
React.createElement(StepPane, { step: w }))),
|
|
39
|
-
...given.thens.map((t, ndx) => React.createElement(Tab.Pane, { eventKey: `bdd-then-${ndx}` },
|
|
40
|
-
React.createElement(StepPane, { step: t }))),
|
|
41
|
-
React.createElement(Tab.Pane, { eventKey: `bdd-errors` },
|
|
42
|
-
React.createElement("pre", null,
|
|
43
|
-
React.createElement("code", null, JSON.stringify(given.error, null, 2)))))))));
|
|
44
|
-
};
|
|
45
|
-
const BddPage = () => {
|
|
46
|
-
const [configs, setConfigs] = useState();
|
|
47
|
-
useEffect(() => {
|
|
48
|
-
(async () => {
|
|
49
|
-
fetch('/kokomoBay/docs/testeranto.json')
|
|
50
|
-
.then(response => response.json())
|
|
51
|
-
.then(json => {
|
|
52
|
-
setConfigs(json);
|
|
53
|
-
})
|
|
54
|
-
.catch(error => console.error(error));
|
|
55
|
-
})();
|
|
56
|
-
}, []);
|
|
57
|
-
const [bddErrors, setBddErrors] = useState();
|
|
58
|
-
useEffect(() => {
|
|
59
|
-
(async () => {
|
|
60
|
-
setBddErrors(await (await fetch(`tests.json`)).json());
|
|
61
|
-
})();
|
|
62
|
-
}, [configs]);
|
|
63
|
-
if (!configs || !bddErrors) {
|
|
64
|
-
return React.createElement("div", null, "loading...");
|
|
65
|
-
}
|
|
66
|
-
return React.createElement("div", null,
|
|
67
|
-
" ",
|
|
68
|
-
React.createElement(Row, null,
|
|
69
|
-
React.createElement(Col, { sm: 12 },
|
|
70
|
-
React.createElement("h2", null, bddErrors.name))),
|
|
71
|
-
React.createElement(Row, null,
|
|
72
|
-
React.createElement(Tab.Container, { id: "root-tab-container", defaultActiveKey: "first" },
|
|
73
|
-
React.createElement(Row, null,
|
|
74
|
-
React.createElement(Col, { sm: 3 },
|
|
75
|
-
React.createElement(Nav, { variant: "pills", className: "flex-column" }, ...bddErrors.givens.map((g) => React.createElement(Nav.Item, null,
|
|
76
|
-
React.createElement(Nav.Link, { eventKey: g.key },
|
|
77
|
-
g.key,
|
|
78
|
-
": Given ",
|
|
79
|
-
g.name))))),
|
|
80
|
-
React.createElement(Col, { sm: 9 },
|
|
81
|
-
React.createElement(Tab.Content, null, ...bddErrors.givens.map((g) => React.createElement(Tab.Pane, { eventKey: g.key },
|
|
82
|
-
React.createElement(TestPane, { given: g })))))))),
|
|
83
|
-
React.createElement(Footer, null));
|
|
84
|
-
};
|
|
85
|
-
document.addEventListener("DOMContentLoaded", function () {
|
|
86
|
-
const elem = document.getElementById("root");
|
|
87
|
-
if (elem) {
|
|
88
|
-
ReactDom.createRoot(elem).render(React.createElement(BddPage, {}, []));
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
console.log("hello BddPage!");
|
package/dist/module/Types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/module/Web.js
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { PM_Web } from "./PM/web";
|
|
2
|
-
import Testeranto from "./lib/core.js";
|
|
3
|
-
import { defaultTestResourceRequirement, } from "./lib/index.js";
|
|
4
|
-
let errorCallback = (e) => { };
|
|
5
|
-
let unhandledrejectionCallback = (event) => {
|
|
6
|
-
console.log("window.addEventListener unhandledrejection", event);
|
|
7
|
-
// cb({ error: event.reason.message });
|
|
8
|
-
// throw event;
|
|
9
|
-
};
|
|
10
|
-
export class WebTesteranto extends Testeranto {
|
|
11
|
-
constructor(input, testSpecification, testImplementation, testResourceRequirement, testInterface) {
|
|
12
|
-
super(input, testSpecification, testImplementation, testResourceRequirement, testInterface, (cb) => {
|
|
13
|
-
window.removeEventListener("error", errorCallback);
|
|
14
|
-
errorCallback = (e) => {
|
|
15
|
-
console.log("window.addEventListener error", e);
|
|
16
|
-
cb(e);
|
|
17
|
-
// throw e;
|
|
18
|
-
};
|
|
19
|
-
window.addEventListener("error", errorCallback);
|
|
20
|
-
window.removeEventListener("unhandledrejection", unhandledrejectionCallback);
|
|
21
|
-
/////////////////////
|
|
22
|
-
window.removeEventListener("unhandledrejection", unhandledrejectionCallback);
|
|
23
|
-
unhandledrejectionCallback = (event) => {
|
|
24
|
-
console.log("window.addEventListener unhandledrejection", event);
|
|
25
|
-
cb({ error: event.reason.message });
|
|
26
|
-
// throw event;
|
|
27
|
-
};
|
|
28
|
-
window.addEventListener("unhandledrejection", unhandledrejectionCallback);
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
async receiveTestResourceConfig(partialTestResource) {
|
|
32
|
-
const t = partialTestResource; //JSON.parse(partialTestResource);
|
|
33
|
-
const pm = new PM_Web(t);
|
|
34
|
-
const { failed, artifacts, logPromise, features } = await this.testJobs[0].receiveTestResourceConfig(pm);
|
|
35
|
-
return new Promise((res, rej) => {
|
|
36
|
-
res({ features, failed });
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
export default async (input, testSpecification, testImplementation, testInterface, testResourceRequirement = defaultTestResourceRequirement) => {
|
|
41
|
-
return new WebTesteranto(input, testSpecification, testImplementation, testResourceRequirement, testInterface);
|
|
42
|
-
};
|
package/dist/module/build.js
DELETED
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
import fs from "fs";
|
|
2
|
-
import path from "path";
|
|
3
|
-
import readline from "readline";
|
|
4
|
-
import { glob } from "glob";
|
|
5
|
-
import esbuild from "esbuild";
|
|
6
|
-
import esbuildNodeConfiger from "./esbuildConfigs/node.js";
|
|
7
|
-
import esbuildWebConfiger from "./esbuildConfigs/web.js";
|
|
8
|
-
import webHtmlFrame from "./web.html.js";
|
|
9
|
-
readline.emitKeypressEvents(process.stdin);
|
|
10
|
-
if (process.stdin.isTTY)
|
|
11
|
-
process.stdin.setRawMode(true);
|
|
12
|
-
const getRunnables = (tests, payload = {
|
|
13
|
-
nodeEntryPoints: {},
|
|
14
|
-
webEntryPoints: {},
|
|
15
|
-
}) => {
|
|
16
|
-
return tests.reduce((pt, cv, cndx, cry) => {
|
|
17
|
-
if (cv[1] === "node") {
|
|
18
|
-
pt.nodeEntryPoints[cv[0]] = path.resolve(`./docs/node/${cv[0].split(".").slice(0, -1).concat("mjs").join(".")}`);
|
|
19
|
-
}
|
|
20
|
-
else if (cv[1] === "web") {
|
|
21
|
-
pt.webEntryPoints[cv[0]] = path.resolve(`./docs/web/${cv[0].split(".").slice(0, -1).concat("mjs").join(".")}`);
|
|
22
|
-
}
|
|
23
|
-
if (cv[3].length) {
|
|
24
|
-
getRunnables(cv[3], payload);
|
|
25
|
-
}
|
|
26
|
-
return pt;
|
|
27
|
-
}, payload);
|
|
28
|
-
};
|
|
29
|
-
import(process.cwd() + "/" + process.argv[2]).then(async (module) => {
|
|
30
|
-
const rawConfig = module.default;
|
|
31
|
-
const getSecondaryEndpointsPoints = (runtime) => {
|
|
32
|
-
const meta = (ts, st) => {
|
|
33
|
-
ts.forEach((t) => {
|
|
34
|
-
if (t[1] === runtime) {
|
|
35
|
-
st.add(t[0]);
|
|
36
|
-
}
|
|
37
|
-
if (Array.isArray(t[3])) {
|
|
38
|
-
meta(t[3], st);
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
return st;
|
|
42
|
-
};
|
|
43
|
-
return Array.from(meta(config.tests, new Set()));
|
|
44
|
-
};
|
|
45
|
-
const config = Object.assign(Object.assign({}, rawConfig), { buildDir: process.cwd() + "/" + rawConfig.outdir });
|
|
46
|
-
let nodeDone = false;
|
|
47
|
-
let webDone = false;
|
|
48
|
-
let mode = config.devMode ? "DEV" : "PROD";
|
|
49
|
-
let status = "build";
|
|
50
|
-
// let pm: PM_Main | undefined = new PM_Main(config);
|
|
51
|
-
// const fileHashes = {};
|
|
52
|
-
const { nodeEntryPoints, webEntryPoints } = getRunnables(config.tests);
|
|
53
|
-
const onNodeDone = () => {
|
|
54
|
-
nodeDone = true;
|
|
55
|
-
onDone();
|
|
56
|
-
};
|
|
57
|
-
const onWebDone = () => {
|
|
58
|
-
webDone = true;
|
|
59
|
-
onDone();
|
|
60
|
-
};
|
|
61
|
-
const onDone = async () => {
|
|
62
|
-
if (nodeDone && webDone) {
|
|
63
|
-
status = "built";
|
|
64
|
-
}
|
|
65
|
-
if (nodeDone && webDone && status === "built") {
|
|
66
|
-
// Object.entries(nodeEntryPoints).forEach(([k, outputFile]) => {
|
|
67
|
-
// console.log("watching", outputFile);
|
|
68
|
-
// try {
|
|
69
|
-
// watch(outputFile, async (filename) => {
|
|
70
|
-
// const hash = await fileHash(outputFile);
|
|
71
|
-
// if (fileHashes[k] !== hash) {
|
|
72
|
-
// fileHashes[k] = hash;
|
|
73
|
-
// console.log(`< ${filename} `);
|
|
74
|
-
// pm.launchNode(k, outputFile);
|
|
75
|
-
// }
|
|
76
|
-
// });
|
|
77
|
-
// } catch (e) {
|
|
78
|
-
// console.error(e);
|
|
79
|
-
// }
|
|
80
|
-
// });
|
|
81
|
-
// Object.entries(webEntryPoints).forEach(([k, outputFile]) => {
|
|
82
|
-
// console.log("watching", outputFile);
|
|
83
|
-
// watch(outputFile, async (filename) => {
|
|
84
|
-
// const hash = await fileHash(outputFile);
|
|
85
|
-
// console.log(`< ${filename} ${hash}`);
|
|
86
|
-
// if (fileHashes[k] !== hash) {
|
|
87
|
-
// fileHashes[k] = hash;
|
|
88
|
-
// pm.launchWeb(k, outputFile);
|
|
89
|
-
// }
|
|
90
|
-
// });
|
|
91
|
-
// });
|
|
92
|
-
}
|
|
93
|
-
if (nodeDone && webDone && mode === "PROD") {
|
|
94
|
-
console.log("Testeranto-EsBuild is all done. Goodbye!");
|
|
95
|
-
process.exit();
|
|
96
|
-
}
|
|
97
|
-
else {
|
|
98
|
-
if (mode === "PROD") {
|
|
99
|
-
console.log("waiting for tests to finish");
|
|
100
|
-
console.log(JSON.stringify({
|
|
101
|
-
nodeDone: nodeDone,
|
|
102
|
-
webDone: webDone,
|
|
103
|
-
mode: mode,
|
|
104
|
-
}, null, 2));
|
|
105
|
-
}
|
|
106
|
-
else {
|
|
107
|
-
console.log("waiting for tests to change");
|
|
108
|
-
}
|
|
109
|
-
if (config.devMode) {
|
|
110
|
-
console.log("ready and watching for changes...");
|
|
111
|
-
}
|
|
112
|
-
else {
|
|
113
|
-
// pm.shutDown();
|
|
114
|
-
}
|
|
115
|
-
////////////////////////////////////////////////////////////////////////////////
|
|
116
|
-
}
|
|
117
|
-
};
|
|
118
|
-
console.log(`Press 'q' to shutdown gracefully. Press 'x' to shutdown forcefully.`);
|
|
119
|
-
process.stdin.on("keypress", (str, key) => {
|
|
120
|
-
if (key.name === "q") {
|
|
121
|
-
console.log("Testeranto-Build is shutting down...");
|
|
122
|
-
mode = "PROD";
|
|
123
|
-
onDone();
|
|
124
|
-
}
|
|
125
|
-
if (key.name === "x") {
|
|
126
|
-
console.log("Testeranto-Build is shutting down forcefully...");
|
|
127
|
-
process.exit(-1);
|
|
128
|
-
}
|
|
129
|
-
});
|
|
130
|
-
fs.writeFileSync(`${config.outdir}/testeranto.json`, JSON.stringify(config, null, 2));
|
|
131
|
-
Promise.resolve(Promise.all([...getSecondaryEndpointsPoints("web")].map(async (sourceFilePath) => {
|
|
132
|
-
const sourceFileSplit = sourceFilePath.split("/");
|
|
133
|
-
const sourceDir = sourceFileSplit.slice(0, -1);
|
|
134
|
-
const sourceFileName = sourceFileSplit[sourceFileSplit.length - 1];
|
|
135
|
-
const sourceFileNameMinusJs = sourceFileName
|
|
136
|
-
.split(".")
|
|
137
|
-
.slice(0, -1)
|
|
138
|
-
.join(".");
|
|
139
|
-
const htmlFilePath = path.normalize(`${process.cwd()}/${config.outdir}/web/${sourceDir.join("/")}/${sourceFileNameMinusJs}.html`);
|
|
140
|
-
const jsfilePath = `./${sourceFileNameMinusJs}.mjs`;
|
|
141
|
-
return fs.promises
|
|
142
|
-
.mkdir(path.dirname(htmlFilePath), { recursive: true })
|
|
143
|
-
.then((x) => fs.writeFileSync(htmlFilePath, webHtmlFrame(jsfilePath, htmlFilePath)));
|
|
144
|
-
})));
|
|
145
|
-
glob(`./${config.outdir}/chunk-*.mjs`, {
|
|
146
|
-
ignore: "node_modules/**",
|
|
147
|
-
}).then((chunks) => {
|
|
148
|
-
chunks.forEach((chunk) => {
|
|
149
|
-
fs.unlinkSync(chunk);
|
|
150
|
-
});
|
|
151
|
-
});
|
|
152
|
-
await Promise.all([
|
|
153
|
-
esbuild
|
|
154
|
-
.context(esbuildNodeConfiger(config, Object.keys(nodeEntryPoints)))
|
|
155
|
-
.then(async (nodeContext) => {
|
|
156
|
-
if (config.devMode) {
|
|
157
|
-
await nodeContext.watch().then((v) => {
|
|
158
|
-
onNodeDone();
|
|
159
|
-
});
|
|
160
|
-
}
|
|
161
|
-
else {
|
|
162
|
-
nodeContext.rebuild().then((v) => {
|
|
163
|
-
onNodeDone();
|
|
164
|
-
});
|
|
165
|
-
}
|
|
166
|
-
return nodeContext;
|
|
167
|
-
}),
|
|
168
|
-
esbuild
|
|
169
|
-
.context(esbuildWebConfiger(config, Object.keys(webEntryPoints)))
|
|
170
|
-
.then(async (webContext) => {
|
|
171
|
-
if (config.devMode) {
|
|
172
|
-
await webContext.watch().then((v) => {
|
|
173
|
-
onWebDone();
|
|
174
|
-
});
|
|
175
|
-
}
|
|
176
|
-
else {
|
|
177
|
-
webContext.rebuild().then((v) => {
|
|
178
|
-
onWebDone();
|
|
179
|
-
});
|
|
180
|
-
}
|
|
181
|
-
return webContext;
|
|
182
|
-
}),
|
|
183
|
-
]);
|
|
184
|
-
});
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
const config = {
|
|
2
|
-
src: "src",
|
|
3
|
-
outdir: "docs",
|
|
4
|
-
tests: [],
|
|
5
|
-
debugger: true,
|
|
6
|
-
clearScreen: false,
|
|
7
|
-
devMode: true,
|
|
8
|
-
minify: false,
|
|
9
|
-
outbase: ".",
|
|
10
|
-
ports: ["3001"],
|
|
11
|
-
externals: [],
|
|
12
|
-
nodePlugins: [],
|
|
13
|
-
webPlugins: [],
|
|
14
|
-
featureIngestor: function (s) {
|
|
15
|
-
throw new Error("Function not implemented.");
|
|
16
|
-
},
|
|
17
|
-
};
|
|
18
|
-
export default config;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import path from "path";
|
|
2
|
-
export default {
|
|
3
|
-
name: "feature-markdown",
|
|
4
|
-
setup(build) {
|
|
5
|
-
build.onResolve({ filter: /\.md$/ }, (args) => {
|
|
6
|
-
if (args.resolveDir === "")
|
|
7
|
-
return;
|
|
8
|
-
return {
|
|
9
|
-
path: path.isAbsolute(args.path)
|
|
10
|
-
? args.path
|
|
11
|
-
: path.join(args.resolveDir, args.path),
|
|
12
|
-
namespace: "feature-markdown",
|
|
13
|
-
};
|
|
14
|
-
});
|
|
15
|
-
build.onLoad({ filter: /.*/, namespace: "feature-markdown" }, async (args) => {
|
|
16
|
-
// const markdownContent = new TextDecoder().decode(
|
|
17
|
-
// await fs.readFileSync(args.path)
|
|
18
|
-
// );
|
|
19
|
-
// markdownHTML = marked(markdownContent, options?.markedOptions);
|
|
20
|
-
return {
|
|
21
|
-
contents: `file://${args.path}`,
|
|
22
|
-
loader: "text",
|
|
23
|
-
// contents: JSON.stringify({ path: args.path }),
|
|
24
|
-
// loader: "json",
|
|
25
|
-
// contents: JSON.stringify({
|
|
26
|
-
// // html: markdownHTML,
|
|
27
|
-
// raw: markdownContent,
|
|
28
|
-
// filename: args.path, //path.basename(args.path),
|
|
29
|
-
// }),
|
|
30
|
-
// loader: "json",
|
|
31
|
-
};
|
|
32
|
-
});
|
|
33
|
-
},
|
|
34
|
-
};
|