testeranto 0.49.10 → 0.62.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 +71 -9
- package/dist/cjs-shim.js +12 -0
- package/dist/common/Features.js +2 -3
- package/dist/common/Node.js +53 -61
- package/dist/common/Project.js +272 -606
- 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 +5 -14
- package/dist/common/{subPackages → SubPackages}/react-test-renderer/MemoExoticComponent/node.js +2 -2
- package/dist/common/{subPackages → SubPackages}/react-test-renderer/component/index.js +26 -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 -2
- 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 +2 -2
- package/dist/common/{subPackages/react/jsx → SubPackages/react-test-renderer/jsx-promised}/node.js +2 -2
- package/dist/common/Types.js +32 -0
- package/dist/common/Web.js +41 -112
- package/dist/common/electron.js +188 -44
- package/dist/common/esbuildConfigs/features.js +14 -0
- package/dist/common/esbuildConfigs/index.js +20 -0
- package/dist/common/esbuildConfigs/node.js +35 -0
- package/dist/common/esbuildConfigs/report.js +48 -0
- package/dist/common/esbuildConfigs/tests.js +14 -0
- package/dist/common/esbuildConfigs/web.js +50 -0
- package/dist/common/lib/abstractBase.js +193 -0
- package/dist/common/lib/basebuilder.js +86 -0
- package/dist/common/lib/browser.js +26 -0
- package/dist/common/lib/classBuilder.js +41 -0
- package/dist/common/lib/core.js +52 -0
- package/dist/common/lib/index.js +19 -0
- package/dist/common/nodeWriterElectron.js +55 -0
- package/dist/common/preload.js +22 -21
- 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 +53 -61
- package/dist/module/Project.js +272 -583
- 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 +5 -5
- 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 +4 -13
- package/dist/module/{subPackages → SubPackages}/react-test-renderer/MemoExoticComponent/node.js +2 -2
- package/dist/module/{subPackages → SubPackages}/react-test-renderer/component/index.js +23 -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 -2
- 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 +2 -2
- package/dist/module/{subPackages/react-test-renderer/jsx → SubPackages/react-test-renderer/jsx-promised}/node.js +1 -1
- package/dist/module/Types.js +30 -1
- package/dist/module/Web.js +41 -112
- package/dist/module/electron.js +189 -45
- package/dist/module/esbuildConfigs/features.js +12 -0
- package/dist/module/esbuildConfigs/index.js +18 -0
- package/dist/module/esbuildConfigs/node.js +30 -0
- package/dist/module/esbuildConfigs/report.js +48 -0
- package/dist/module/esbuildConfigs/tests.js +12 -0
- package/dist/module/esbuildConfigs/web.js +45 -0
- package/dist/module/lib/abstractBase.js +185 -0
- package/dist/module/lib/basebuilder.js +82 -0
- package/dist/module/lib/browser.js +22 -0
- package/dist/module/lib/classBuilder.js +37 -0
- package/dist/module/lib/core.js +49 -0
- package/dist/module/lib/index.js +15 -0
- package/dist/module/nodeWriterElectron.js +52 -0
- package/dist/module/preload.js +22 -21
- 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 +4 -11
- package/dist/types/NodeWriter.d.ts +1 -1
- package/dist/types/Project.d.ts +2 -27
- 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 → SubPackages}/react-dom/component/node.d.ts +2 -4
- 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/react-test-renderer/component/node.d.ts +9 -0
- 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 +116 -3
- package/dist/types/Web.d.ts +4 -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 +0 -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 +102 -0
- package/dist/types/lib/basebuilder.d.ts +24 -0
- package/dist/types/lib/browser.d.ts +6 -0
- package/dist/types/lib/classBuilder.d.ts +6 -0
- package/dist/types/lib/core.d.ts +7 -0
- package/dist/types/lib/index.d.ts +57 -0
- package/dist/types/nodeWriterElectron.d.ts +2 -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 +120 -85
- package/src/Features.ts +2 -4
- package/src/Node.ts +114 -160
- package/src/NodeWriter.ts +1 -4
- package/src/Project.ts +610 -753
- package/src/Report.tsx +30 -15
- package/src/SubPackages/puppeteer.ts +46 -0
- package/src/{subPackages → SubPackages}/react/component/node.ts +12 -32
- package/src/SubPackages/react/component/web.ts +53 -0
- package/src/SubPackages/react/jsx/index.ts +43 -0
- package/src/SubPackages/react/jsx/node.ts +29 -0
- package/src/SubPackages/react/jsx/web.ts +28 -0
- package/src/{subPackages → SubPackages}/react-dom/component/node.ts +11 -25
- package/src/{subPackages → SubPackages}/react-dom/component/web.ts +27 -32
- package/src/{subPackages → SubPackages}/react-dom/jsx/index.ts +0 -1
- package/src/SubPackages/react-dom/jsx/node.ts +68 -0
- package/src/{subPackages → SubPackages}/react-dom/jsx/web.ts +18 -54
- package/src/{subPackages → SubPackages}/react-test-renderer/MemoExoticComponent/node.ts +9 -28
- package/src/{subPackages → SubPackages}/react-test-renderer/component/index.ts +31 -29
- package/src/SubPackages/react-test-renderer/component/node.ts +22 -0
- package/src/SubPackages/react-test-renderer/component/web.ts +22 -0
- package/src/{subPackages → SubPackages}/react-test-renderer/fc/node.ts +14 -28
- package/src/{subPackages → SubPackages}/react-test-renderer/fc/web.ts +9 -25
- package/src/{subPackages → SubPackages}/react-test-renderer/jsx/index.ts +19 -16
- package/src/SubPackages/react-test-renderer/jsx/node.ts +24 -0
- package/src/SubPackages/react-test-renderer/jsx/web.ts +20 -0
- package/src/{subPackages → SubPackages}/react-test-renderer/jsx-promised/index.ts +7 -15
- 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 +334 -3
- package/src/Web.ts +104 -230
- package/src/cjs-shim.js +12 -0
- package/src/electron.ts +237 -46
- package/src/esbuildConfigs/features.ts +18 -0
- package/src/esbuildConfigs/index.ts +22 -0
- package/src/esbuildConfigs/node.ts +59 -0
- package/src/esbuildConfigs/report.ts +51 -0
- package/src/esbuildConfigs/tests.ts +20 -0
- package/src/esbuildConfigs/web.ts +73 -0
- package/src/lib/abstractBase.ts +459 -0
- package/src/lib/basebuilder.ts +253 -0
- package/src/lib/browser.ts +34 -0
- package/src/lib/classBuilder.ts +137 -0
- package/src/lib/core.ts +182 -0
- package/src/lib/index.ts +116 -0
- package/src/nodeWriterElectron.ts +71 -0
- package/src/preload.ts +23 -21
- 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/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/node.d.ts +0 -9
- 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/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/jsx/node.ts +0 -145
- 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/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
package/dist/module/Report.js
DELETED
|
@@ -1,186 +0,0 @@
|
|
|
1
|
-
import React, { useEffect, useState } from "react";
|
|
2
|
-
import ReactDom from "react-dom/client";
|
|
3
|
-
import Col from 'react-bootstrap/Col';
|
|
4
|
-
import Nav from 'react-bootstrap/Nav';
|
|
5
|
-
import Row from 'react-bootstrap/Row';
|
|
6
|
-
import Tab from 'react-bootstrap/Tab';
|
|
7
|
-
import Tabs from 'react-bootstrap/Tabs';
|
|
8
|
-
import { Sigma, RandomizeNodePositions, RelativeSize } from 'react-sigma';
|
|
9
|
-
import 'bootstrap/dist/css/bootstrap.min.css';
|
|
10
|
-
import { TesterantoFeatures } from "./Features";
|
|
11
|
-
const graphToIGraphData = (g) => {
|
|
12
|
-
return {
|
|
13
|
-
nodes: g.nodes().map((n) => {
|
|
14
|
-
return {
|
|
15
|
-
id: n,
|
|
16
|
-
label: n
|
|
17
|
-
};
|
|
18
|
-
}),
|
|
19
|
-
edges: g.mapEdges((id, attributes, source, target) => {
|
|
20
|
-
return {
|
|
21
|
-
id,
|
|
22
|
-
label: id,
|
|
23
|
-
source,
|
|
24
|
-
target,
|
|
25
|
-
};
|
|
26
|
-
})
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
document.addEventListener("DOMContentLoaded", function () {
|
|
30
|
-
const elem = document.getElementById("root");
|
|
31
|
-
if (elem) {
|
|
32
|
-
ReactDom.createRoot(elem).render(React.createElement(Report, {}));
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
const Report = () => {
|
|
36
|
-
const [tests, setTests] = useState([]);
|
|
37
|
-
const [features, setFeatures] = useState(new TesterantoFeatures({}, {
|
|
38
|
-
undirected: [],
|
|
39
|
-
directed: [],
|
|
40
|
-
dags: []
|
|
41
|
-
}));
|
|
42
|
-
useEffect(() => {
|
|
43
|
-
const importTests = async () => {
|
|
44
|
-
const module = await import('tests.test.js');
|
|
45
|
-
setTests(module.default);
|
|
46
|
-
};
|
|
47
|
-
importTests();
|
|
48
|
-
}, []);
|
|
49
|
-
useEffect(() => {
|
|
50
|
-
const importFeatures = async () => {
|
|
51
|
-
const module = await import('features.test.js');
|
|
52
|
-
setFeatures(module.default);
|
|
53
|
-
};
|
|
54
|
-
importFeatures();
|
|
55
|
-
}, []);
|
|
56
|
-
return (React.createElement("div", null,
|
|
57
|
-
React.createElement("style", null, `
|
|
58
|
-
pre, code, p {
|
|
59
|
-
max-width: 30rem;
|
|
60
|
-
}
|
|
61
|
-
footer {
|
|
62
|
-
background-color: lightgray;
|
|
63
|
-
margin: 0.5rem;
|
|
64
|
-
padding: 0.5rem;
|
|
65
|
-
position: fixed;
|
|
66
|
-
bottom: 0;
|
|
67
|
-
right: 0;
|
|
68
|
-
}
|
|
69
|
-
`),
|
|
70
|
-
features && tests && React.createElement(Tabs, { defaultActiveKey: "home" },
|
|
71
|
-
React.createElement(Tab, { eventKey: "home", title: "config" },
|
|
72
|
-
React.createElement("pre", null, JSON.stringify(features, null, 2)),
|
|
73
|
-
React.createElement("pre", null, JSON.stringify(tests, null, 2))),
|
|
74
|
-
React.createElement(Tab, { eventKey: "features", title: "features" },
|
|
75
|
-
React.createElement(Tab.Container, { id: "left-tabs-example5", defaultActiveKey: "feature-0" },
|
|
76
|
-
React.createElement(Row, null,
|
|
77
|
-
React.createElement(Col, { sm: 2 },
|
|
78
|
-
React.createElement(Nav, { variant: "pills", className: "flex-column" }, Object.keys(features.features).map((featureKey, ndx) => React.createElement(Nav.Item, { key: ndx },
|
|
79
|
-
React.createElement(Nav.Link, { eventKey: `feature-${ndx}` }, featureKey))))),
|
|
80
|
-
React.createElement(Col, { sm: 6 },
|
|
81
|
-
React.createElement(Tab.Content, null, Object.keys(features.features).map((featureKey, ndx) => {
|
|
82
|
-
const feature = features[featureKey];
|
|
83
|
-
return (React.createElement(Tab.Pane, { eventKey: `feature-${ndx}`, key: ndx },
|
|
84
|
-
React.createElement("pre", null, JSON.stringify(feature, null, 2))));
|
|
85
|
-
}))),
|
|
86
|
-
React.createElement(Col, { sm: 4 },
|
|
87
|
-
React.createElement(Tabs, { defaultActiveKey: "feature.networks" },
|
|
88
|
-
React.createElement(Tab, { eventKey: "feature.networks", title: "networks" },
|
|
89
|
-
React.createElement(Tabs, { defaultActiveKey: "dag" },
|
|
90
|
-
React.createElement(Tab, { eventKey: "dag", title: "DAG" },
|
|
91
|
-
React.createElement(Tab.Content, null,
|
|
92
|
-
React.createElement("pre", null, JSON.stringify(features.graphs.dags, null, 2)))),
|
|
93
|
-
React.createElement(Tab, { eventKey: "directed", title: "Directed" },
|
|
94
|
-
React.createElement(Tab.Content, null,
|
|
95
|
-
React.createElement("pre", null, JSON.stringify(features.graphs.directed, null, 2)))),
|
|
96
|
-
React.createElement(Tab, { eventKey: "undirected", title: "Undirected" },
|
|
97
|
-
React.createElement(Tab.Content, null,
|
|
98
|
-
React.createElement("pre", null, JSON.stringify(features.graphs.undirected, null, 2)))))),
|
|
99
|
-
React.createElement(Tab, { eventKey: "feature.tests", title: "tests" },
|
|
100
|
-
React.createElement("pre", { id: "theProps" }, JSON.stringify(tests, null, 2)))))))),
|
|
101
|
-
React.createElement(Tab, { eventKey: "networks", title: "networks" },
|
|
102
|
-
React.createElement(Tab.Container, { id: "left-tabs-example88", defaultActiveKey: `dag` },
|
|
103
|
-
React.createElement(Row, null,
|
|
104
|
-
React.createElement(Tabs, { defaultActiveKey: "dag" },
|
|
105
|
-
React.createElement(Tab, { eventKey: "dag", title: "DAG" },
|
|
106
|
-
React.createElement(Tab.Content, null,
|
|
107
|
-
React.createElement(Row, null,
|
|
108
|
-
React.createElement(Col, { sm: 2 },
|
|
109
|
-
React.createElement(Nav, { variant: "pills", className: "flex-column" }, features.graphs.dags.map((g, ndx2) => React.createElement(Nav.Item, { key: ndx2 },
|
|
110
|
-
React.createElement(Nav.Link, { eventKey: `networks-dags-${ndx2}` }, g.name))))),
|
|
111
|
-
React.createElement(Col, { sm: 6 },
|
|
112
|
-
React.createElement(Tab.Content, null, features.graphs.dags[0] && React.createElement(React.Fragment, null,
|
|
113
|
-
React.createElement(Sigma, { graph: graphToIGraphData(features.graphs.dags[0].graph), settings: { drawEdges: true, clone: false } },
|
|
114
|
-
React.createElement(RelativeSize, { initialSize: 25 }),
|
|
115
|
-
React.createElement(RandomizeNodePositions, null)),
|
|
116
|
-
React.createElement("pre", null, JSON.stringify(features.graphs.dags[0].graph, null, 2))))),
|
|
117
|
-
React.createElement(Col, { sm: 4 },
|
|
118
|
-
React.createElement(Tabs, { defaultActiveKey: "networks.features" },
|
|
119
|
-
React.createElement(Tab, { eventKey: "networks.features", title: "features" },
|
|
120
|
-
React.createElement("pre", { id: "theProps" }, JSON.stringify(features, null, 2))),
|
|
121
|
-
React.createElement(Tab, { eventKey: "feature.tests", title: "tests" },
|
|
122
|
-
React.createElement("pre", { id: "theProps" }, JSON.stringify(tests, null, 2)))))))),
|
|
123
|
-
React.createElement(Tab, { eventKey: "directed", title: "Directed" },
|
|
124
|
-
React.createElement(Tab.Content, null,
|
|
125
|
-
React.createElement(Row, null,
|
|
126
|
-
React.createElement(Col, { sm: 2 },
|
|
127
|
-
React.createElement(Nav, { variant: "pills", className: "flex-column" }, features.graphs.directed.map((g, ndx2) => React.createElement(Nav.Item, { key: ndx2 },
|
|
128
|
-
React.createElement(Nav.Link, { eventKey: `networks-directed-${ndx2}` }, g.name))))),
|
|
129
|
-
React.createElement(Col, { sm: 6 },
|
|
130
|
-
React.createElement(Tab.Content, null, features.graphs.directed[0] && React.createElement(React.Fragment, null,
|
|
131
|
-
React.createElement(Sigma, { graph: graphToIGraphData(features.graphs.directed[0].graph), settings: { drawEdges: true, clone: false } },
|
|
132
|
-
React.createElement(RelativeSize, { initialSize: 25 }),
|
|
133
|
-
React.createElement(RandomizeNodePositions, null)),
|
|
134
|
-
React.createElement("pre", null, JSON.stringify(features.graphs.directed[0].graph, null, 2))))),
|
|
135
|
-
React.createElement(Col, { sm: 4 },
|
|
136
|
-
React.createElement(Tabs, { defaultActiveKey: "networks.features" },
|
|
137
|
-
React.createElement(Tab, { eventKey: "networks.features", title: "features" },
|
|
138
|
-
React.createElement("pre", { id: "theProps" }, JSON.stringify(features, null, 2))),
|
|
139
|
-
React.createElement(Tab, { eventKey: "feature.tests", title: "tests" },
|
|
140
|
-
React.createElement("pre", { id: "theProps" }, JSON.stringify(tests, null, 2)))))))),
|
|
141
|
-
React.createElement(Tab, { eventKey: "undirected", title: "Undirected" },
|
|
142
|
-
React.createElement(Tab.Content, null,
|
|
143
|
-
React.createElement(Row, null,
|
|
144
|
-
React.createElement(Col, { sm: 2 },
|
|
145
|
-
React.createElement(Nav, { variant: "pills", className: "flex-column" }, features.graphs.undirected.map((g, ndx2) => React.createElement(Nav.Item, { key: ndx2 },
|
|
146
|
-
React.createElement(Nav.Link, { eventKey: `networks-undirected-${ndx2}` }, g.name))))),
|
|
147
|
-
React.createElement(Col, { sm: 6 },
|
|
148
|
-
React.createElement(Tab.Content, null, features.graphs.undirected[0] && React.createElement(React.Fragment, null,
|
|
149
|
-
React.createElement(Sigma, { graph: graphToIGraphData(features.graphs.undirected[0].graph), settings: { drawEdges: true, clone: false } },
|
|
150
|
-
React.createElement(RelativeSize, { initialSize: 25 }),
|
|
151
|
-
React.createElement(RandomizeNodePositions, null)),
|
|
152
|
-
React.createElement("pre", null, JSON.stringify(features.graphs.undirected[0].graph, null, 2))))),
|
|
153
|
-
React.createElement(Col, { sm: 4 },
|
|
154
|
-
React.createElement(Tabs, { defaultActiveKey: "networks.features" },
|
|
155
|
-
React.createElement(Tab, { eventKey: "networks.features", title: "features" },
|
|
156
|
-
React.createElement("pre", { id: "theProps" }, JSON.stringify(features, null, 2))),
|
|
157
|
-
React.createElement(Tab, { eventKey: "feature.tests", title: "tests" },
|
|
158
|
-
React.createElement("pre", { id: "theProps" }, JSON.stringify(tests, null, 2)))))))))))),
|
|
159
|
-
React.createElement(Tab, { eventKey: "results", title: "tests" },
|
|
160
|
-
React.createElement(Tab.Container, { id: "left-tabs-example5", defaultActiveKey: "feature-0" },
|
|
161
|
-
React.createElement(Row, null,
|
|
162
|
-
React.createElement(Col, { sm: 2 }),
|
|
163
|
-
React.createElement(Col, { sm: 6 },
|
|
164
|
-
React.createElement(Tab.Content, null, tests.map((t, ndx) => {
|
|
165
|
-
return (React.createElement(Tab.Pane, { eventKey: `feature-${ndx}`, key: ndx },
|
|
166
|
-
React.createElement("pre", null, JSON.stringify(t, null, 2))));
|
|
167
|
-
}))),
|
|
168
|
-
React.createElement(Col, { sm: 4 },
|
|
169
|
-
React.createElement(Tabs, { defaultActiveKey: "feature.networks" },
|
|
170
|
-
React.createElement(Tab, { eventKey: "feature.networks", title: "networks" },
|
|
171
|
-
React.createElement(Tabs, { defaultActiveKey: "dag" },
|
|
172
|
-
React.createElement(Tab, { eventKey: "dag", title: "DAG" },
|
|
173
|
-
React.createElement(Tab.Content, null,
|
|
174
|
-
React.createElement("pre", null, JSON.stringify(features.graphs.dags, null, 2)))),
|
|
175
|
-
React.createElement(Tab, { eventKey: "directed", title: "Directed" },
|
|
176
|
-
React.createElement(Tab.Content, null,
|
|
177
|
-
React.createElement("pre", null, JSON.stringify(features.graphs.directed, null, 2)))),
|
|
178
|
-
React.createElement(Tab, { eventKey: "undirected", title: "Undirected" },
|
|
179
|
-
React.createElement(Tab.Content, null,
|
|
180
|
-
React.createElement("pre", null, JSON.stringify(features.graphs.undirected, null, 2)))))),
|
|
181
|
-
React.createElement(Tab, { eventKey: "tests.features", title: "features" },
|
|
182
|
-
React.createElement("pre", { id: "theProps" }, JSON.stringify(features, null, 2))))))))),
|
|
183
|
-
React.createElement("footer", null,
|
|
184
|
-
"made with \u2764\uFE0F and ",
|
|
185
|
-
React.createElement("a", { href: "https://adamwong246.github.io/testeranto/" }, "testeranto "))));
|
|
186
|
-
};
|
package/dist/module/core.js
DELETED
|
@@ -1,388 +0,0 @@
|
|
|
1
|
-
const defaultTestResource = {
|
|
2
|
-
name: "",
|
|
3
|
-
fs: ".",
|
|
4
|
-
ports: [],
|
|
5
|
-
scheduled: false
|
|
6
|
-
};
|
|
7
|
-
export const defaultTestResourceRequirement = {
|
|
8
|
-
ports: 0
|
|
9
|
-
};
|
|
10
|
-
export class BaseSuite {
|
|
11
|
-
constructor(name, index, givens = {}, checks = []) {
|
|
12
|
-
this.name = name;
|
|
13
|
-
this.index = index;
|
|
14
|
-
this.givens = givens;
|
|
15
|
-
this.checks = checks;
|
|
16
|
-
this.fails = [];
|
|
17
|
-
}
|
|
18
|
-
toObj() {
|
|
19
|
-
return {
|
|
20
|
-
name: this.name,
|
|
21
|
-
givens: Object.keys(this.givens).map((k) => this.givens[k].toObj()),
|
|
22
|
-
fails: this.fails,
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
setup(s, artifactory) {
|
|
26
|
-
return new Promise((res) => res(s));
|
|
27
|
-
}
|
|
28
|
-
test(t) {
|
|
29
|
-
return t;
|
|
30
|
-
}
|
|
31
|
-
async run(input, testResourceConfiguration, artifactory, tLog) {
|
|
32
|
-
this.testResourceConfiguration = testResourceConfiguration;
|
|
33
|
-
const suiteArtifactory = (fPath, value) => artifactory(`suite-${this.index}-${this.name}/${fPath}`, value);
|
|
34
|
-
const subject = await this.setup(input, suiteArtifactory);
|
|
35
|
-
tLog("\nSuite:", this.index, this.name);
|
|
36
|
-
for (const k of Object.keys(this.givens)) {
|
|
37
|
-
const giver = this.givens[k];
|
|
38
|
-
try {
|
|
39
|
-
this.store = await giver.give(subject, k, testResourceConfiguration, this.test, suiteArtifactory, tLog);
|
|
40
|
-
}
|
|
41
|
-
catch (e) {
|
|
42
|
-
console.error(e);
|
|
43
|
-
this.fails.push(giver);
|
|
44
|
-
return this;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
for (const [ndx, thater] of this.checks.entries()) {
|
|
48
|
-
await thater.check(subject, thater.name, testResourceConfiguration, this.test, suiteArtifactory, tLog);
|
|
49
|
-
}
|
|
50
|
-
// @TODO fix me
|
|
51
|
-
for (const k of Object.keys(this.givens)) {
|
|
52
|
-
const giver = this.givens[k];
|
|
53
|
-
giver.afterAll(this.store, artifactory);
|
|
54
|
-
}
|
|
55
|
-
////////////////
|
|
56
|
-
return this;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
export class BaseGiven {
|
|
60
|
-
constructor(name, features, whens, thens) {
|
|
61
|
-
this.name = name;
|
|
62
|
-
this.features = features;
|
|
63
|
-
this.whens = whens;
|
|
64
|
-
this.thens = thens;
|
|
65
|
-
}
|
|
66
|
-
beforeAll(store, artifactory) {
|
|
67
|
-
return store;
|
|
68
|
-
}
|
|
69
|
-
afterAll(store, artifactory) {
|
|
70
|
-
return store;
|
|
71
|
-
}
|
|
72
|
-
toObj() {
|
|
73
|
-
return {
|
|
74
|
-
name: this.name,
|
|
75
|
-
whens: this.whens.map((w) => w.toObj()),
|
|
76
|
-
thens: this.thens.map((t) => t.toObj()),
|
|
77
|
-
error: this.error ? [this.error, this.error.stack] : null,
|
|
78
|
-
features: this.features,
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
async afterEach(store, key, artifactory) {
|
|
82
|
-
return store;
|
|
83
|
-
}
|
|
84
|
-
async give(subject, key, testResourceConfiguration, tester, artifactory, tLog) {
|
|
85
|
-
tLog(`\n Given: ${this.name}`);
|
|
86
|
-
const givenArtifactory = (fPath, value) => artifactory(`given-${key}/${fPath}`, value);
|
|
87
|
-
try {
|
|
88
|
-
this.store = await this.givenThat(subject, testResourceConfiguration, givenArtifactory);
|
|
89
|
-
// tLog(`\n Given this.store`, this.store);
|
|
90
|
-
for (const whenStep of this.whens) {
|
|
91
|
-
await whenStep.test(this.store, testResourceConfiguration, tLog);
|
|
92
|
-
}
|
|
93
|
-
for (const thenStep of this.thens) {
|
|
94
|
-
const t = await thenStep.test(this.store, testResourceConfiguration, tLog);
|
|
95
|
-
tester(t);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
catch (e) {
|
|
99
|
-
this.error = e;
|
|
100
|
-
tLog(e);
|
|
101
|
-
tLog("\u0007"); // bell
|
|
102
|
-
// throw e;
|
|
103
|
-
}
|
|
104
|
-
finally {
|
|
105
|
-
try {
|
|
106
|
-
await this.afterEach(this.store, key, givenArtifactory);
|
|
107
|
-
}
|
|
108
|
-
catch (e) {
|
|
109
|
-
console.error("afterEach failed! no error will be recorded!", e);
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
return this.store;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
export class BaseWhen {
|
|
116
|
-
constructor(name, actioner) {
|
|
117
|
-
this.name = name;
|
|
118
|
-
this.actioner = actioner;
|
|
119
|
-
}
|
|
120
|
-
toObj() {
|
|
121
|
-
return {
|
|
122
|
-
name: this.name,
|
|
123
|
-
error: this.error,
|
|
124
|
-
};
|
|
125
|
-
}
|
|
126
|
-
async test(store, testResourceConfiguration, tLog) {
|
|
127
|
-
tLog(" When:", this.name);
|
|
128
|
-
try {
|
|
129
|
-
return await this.andWhen(store, this.actioner, testResourceConfiguration);
|
|
130
|
-
}
|
|
131
|
-
catch (e) {
|
|
132
|
-
this.error = true;
|
|
133
|
-
throw e;
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
export class BaseThen {
|
|
138
|
-
constructor(name, thenCB) {
|
|
139
|
-
this.name = name;
|
|
140
|
-
this.thenCB = thenCB;
|
|
141
|
-
}
|
|
142
|
-
toObj() {
|
|
143
|
-
return {
|
|
144
|
-
name: this.name,
|
|
145
|
-
error: this.error,
|
|
146
|
-
};
|
|
147
|
-
}
|
|
148
|
-
async test(store, testResourceConfiguration, tLog) {
|
|
149
|
-
tLog(" Then:", this.name);
|
|
150
|
-
try {
|
|
151
|
-
return this.thenCB(await this.butThen(store, testResourceConfiguration));
|
|
152
|
-
}
|
|
153
|
-
catch (e) {
|
|
154
|
-
console.log("test failed", e);
|
|
155
|
-
this.error = true;
|
|
156
|
-
throw e;
|
|
157
|
-
}
|
|
158
|
-
// try {
|
|
159
|
-
// return await (this.thenCB(
|
|
160
|
-
// await (async () => {
|
|
161
|
-
// try {
|
|
162
|
-
// return await (
|
|
163
|
-
// (() => {
|
|
164
|
-
// try {
|
|
165
|
-
// return this.butThen(store, testResourceConfiguration)
|
|
166
|
-
// } catch (e) {
|
|
167
|
-
// this.error = true;
|
|
168
|
-
// throw e
|
|
169
|
-
// }
|
|
170
|
-
// })()
|
|
171
|
-
// );
|
|
172
|
-
// } catch (e) {
|
|
173
|
-
// this.error = true;
|
|
174
|
-
// throw e
|
|
175
|
-
// }
|
|
176
|
-
// })()
|
|
177
|
-
// ));
|
|
178
|
-
// } catch (e) {
|
|
179
|
-
// this.error = true;
|
|
180
|
-
// throw e
|
|
181
|
-
// }
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
export class BaseCheck {
|
|
185
|
-
constructor(name, features, checkCB, whens, thens) {
|
|
186
|
-
this.name = name;
|
|
187
|
-
this.features = features;
|
|
188
|
-
this.checkCB = checkCB;
|
|
189
|
-
this.whens = whens;
|
|
190
|
-
this.thens = thens;
|
|
191
|
-
}
|
|
192
|
-
async afterEach(store, key, cb) {
|
|
193
|
-
return;
|
|
194
|
-
}
|
|
195
|
-
async check(subject, key, testResourceConfiguration, tester, artifactory, tLog) {
|
|
196
|
-
tLog(`\n Check: ${this.name}`);
|
|
197
|
-
const store = await this.checkThat(subject, testResourceConfiguration, artifactory);
|
|
198
|
-
await this.checkCB(Object.entries(this.whens).reduce((a, [key, when]) => {
|
|
199
|
-
a[key] = async (payload) => {
|
|
200
|
-
return await when(payload, testResourceConfiguration).test(store, testResourceConfiguration, tLog);
|
|
201
|
-
};
|
|
202
|
-
return a;
|
|
203
|
-
}, {}), Object.entries(this.thens).reduce((a, [key, then]) => {
|
|
204
|
-
a[key] = async (payload) => {
|
|
205
|
-
const t = await then(payload, testResourceConfiguration).test(store, testResourceConfiguration, tLog);
|
|
206
|
-
tester(t);
|
|
207
|
-
};
|
|
208
|
-
return a;
|
|
209
|
-
}, {}));
|
|
210
|
-
await this.afterEach(store, key);
|
|
211
|
-
return;
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
///////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
215
|
-
class TesterantoLevelZero {
|
|
216
|
-
constructor(cc, suitesOverrides, givenOverides, whenOverides, thenOverides, checkOverides) {
|
|
217
|
-
this.cc = cc;
|
|
218
|
-
this.constructorator = cc;
|
|
219
|
-
this.suitesOverrides = suitesOverrides;
|
|
220
|
-
this.givenOverides = givenOverides;
|
|
221
|
-
this.whenOverides = whenOverides;
|
|
222
|
-
this.thenOverides = thenOverides;
|
|
223
|
-
this.checkOverides = checkOverides;
|
|
224
|
-
}
|
|
225
|
-
Suites() {
|
|
226
|
-
return this.suitesOverrides;
|
|
227
|
-
}
|
|
228
|
-
Given() {
|
|
229
|
-
return this.givenOverides;
|
|
230
|
-
}
|
|
231
|
-
When() {
|
|
232
|
-
return this.whenOverides;
|
|
233
|
-
}
|
|
234
|
-
Then() {
|
|
235
|
-
return this.thenOverides;
|
|
236
|
-
}
|
|
237
|
-
Check() {
|
|
238
|
-
return this.checkOverides;
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
///////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
242
|
-
class TesterantoLevelOne {
|
|
243
|
-
constructor(testImplementation, testSpecification, input, suiteKlasser, givenKlasser, whenKlasser, thenKlasser, checkKlasser, testResourceRequirement, logWriter) {
|
|
244
|
-
this.artifacts = [];
|
|
245
|
-
console.log("core TesterantoLevelOne logWriter", logWriter);
|
|
246
|
-
const classySuites = Object.entries(testImplementation.Suites).reduce((a, [key], index) => {
|
|
247
|
-
a[key] = (somestring, givens, checks) => {
|
|
248
|
-
return new suiteKlasser.prototype.constructor(somestring, index, givens, checks);
|
|
249
|
-
};
|
|
250
|
-
return a;
|
|
251
|
-
}, {});
|
|
252
|
-
const classyGivens = Object.keys(testImplementation.Givens)
|
|
253
|
-
.reduce((a, key) => {
|
|
254
|
-
a[key] = (features, whens, thens, ...xtrasW) => {
|
|
255
|
-
return new givenKlasser.prototype.constructor(key, features, whens, thens, testImplementation.Givens[key](...xtrasW));
|
|
256
|
-
};
|
|
257
|
-
return a;
|
|
258
|
-
}, {});
|
|
259
|
-
const classyWhens = Object.entries(testImplementation.Whens).reduce((a, [key, whEn]) => {
|
|
260
|
-
a[key] = (payload) => {
|
|
261
|
-
return new whenKlasser.prototype.constructor(`${whEn.name}: ${payload && payload.toString()}`, whEn(payload));
|
|
262
|
-
};
|
|
263
|
-
return a;
|
|
264
|
-
}, {});
|
|
265
|
-
const classyThens = Object.entries(testImplementation.Thens).reduce((a, [key, thEn]) => {
|
|
266
|
-
a[key] = (expected, x) => {
|
|
267
|
-
return new thenKlasser.prototype.constructor(`${thEn.name}: ${expected && expected.toString()}`, thEn(expected));
|
|
268
|
-
};
|
|
269
|
-
return a;
|
|
270
|
-
}, {});
|
|
271
|
-
const classyChecks = Object.entries(testImplementation.Checks).reduce((a, [key, z]) => {
|
|
272
|
-
a[key] = (somestring, features, callback) => {
|
|
273
|
-
return new checkKlasser.prototype.constructor(somestring, features, callback, classyWhens, classyThens);
|
|
274
|
-
};
|
|
275
|
-
return a;
|
|
276
|
-
}, {});
|
|
277
|
-
const classyTesteranto = new (class extends TesterantoLevelZero {
|
|
278
|
-
})(input, classySuites, classyGivens, classyWhens, classyThens, classyChecks);
|
|
279
|
-
const suites = testSpecification(
|
|
280
|
-
/* @ts-ignore:next-line */
|
|
281
|
-
classyTesteranto.Suites(), classyTesteranto.Given(), classyTesteranto.When(), classyTesteranto.Then(), classyTesteranto.Check(), logWriter);
|
|
282
|
-
const suiteRunner = (suite) => async (testResourceConfiguration, tLog) => {
|
|
283
|
-
return await suite.run(input, testResourceConfiguration, (fPath, value) => logWriter.testArtiFactoryfileWriter(tLog, (p) => {
|
|
284
|
-
artifacts.push(p);
|
|
285
|
-
})(testResourceConfiguration.fs + "/" + fPath, value), tLog);
|
|
286
|
-
};
|
|
287
|
-
const artifacts = this.artifacts;
|
|
288
|
-
this.testJobs = suites.map((suite) => {
|
|
289
|
-
const runner = suiteRunner(suite);
|
|
290
|
-
return {
|
|
291
|
-
test: suite,
|
|
292
|
-
testResourceRequirement,
|
|
293
|
-
toObj: () => {
|
|
294
|
-
return suite.toObj();
|
|
295
|
-
},
|
|
296
|
-
runner,
|
|
297
|
-
receiveTestResourceConfig: async function (testResourceConfiguration = defaultTestResource) {
|
|
298
|
-
console.log(`testResourceConfiguration ${JSON.stringify(testResourceConfiguration, null, 2)}`);
|
|
299
|
-
await logWriter.mkdirSync(testResourceConfiguration.fs);
|
|
300
|
-
const logFilePath = (`${testResourceConfiguration.fs}/log.txt`);
|
|
301
|
-
const access = await logWriter.createWriteStream(logFilePath);
|
|
302
|
-
const tLog = (...l) => {
|
|
303
|
-
console.log(...l);
|
|
304
|
-
access.write(`${l.toString()}\n`);
|
|
305
|
-
};
|
|
306
|
-
const suiteDone = await runner(testResourceConfiguration, tLog);
|
|
307
|
-
const resultsFilePath = (`${testResourceConfiguration.fs}/results.json`);
|
|
308
|
-
logWriter.writeFileSync(resultsFilePath, JSON.stringify(suiteDone.toObj(), null, 2));
|
|
309
|
-
const logPromise = new Promise((res, rej) => {
|
|
310
|
-
access.on("finish", () => { res(true); });
|
|
311
|
-
});
|
|
312
|
-
access.end();
|
|
313
|
-
const numberOfFailures = Object.keys(suiteDone.givens).filter((k) => {
|
|
314
|
-
// console.log(`suiteDone.givens[k].error`, suiteDone.givens[k].error);
|
|
315
|
-
return suiteDone.givens[k].error;
|
|
316
|
-
}).length;
|
|
317
|
-
console.log(`exiting gracefully with ${numberOfFailures} failures.`);
|
|
318
|
-
return {
|
|
319
|
-
failed: numberOfFailures,
|
|
320
|
-
artifacts,
|
|
321
|
-
logPromise
|
|
322
|
-
};
|
|
323
|
-
},
|
|
324
|
-
};
|
|
325
|
-
});
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
////////////////////////////////////////////////////////////////////////////////////////////////
|
|
329
|
-
export default class TesterantoLevelTwo extends TesterantoLevelOne {
|
|
330
|
-
constructor(input, testSpecification, testImplementation, testInterface, testResourceRequirement = defaultTestResourceRequirement, assertioner, beforeEach, afterEach, afterAll, butThen, andWhen, actionHandler, logWriter) {
|
|
331
|
-
super(testImplementation, testSpecification, input, class extends BaseSuite {
|
|
332
|
-
async setup(s, artifactory) {
|
|
333
|
-
return (testInterface.beforeAll || (async (input, artificer) => input))(s, artifactory, this.testResourceConfiguration);
|
|
334
|
-
}
|
|
335
|
-
test(t) {
|
|
336
|
-
return assertioner(t);
|
|
337
|
-
}
|
|
338
|
-
}, class Given extends BaseGiven {
|
|
339
|
-
constructor(name, features, whens, thens, initialValues) {
|
|
340
|
-
super(name, features, whens, thens);
|
|
341
|
-
this.initialValues = initialValues;
|
|
342
|
-
}
|
|
343
|
-
async givenThat(subject, testResource, artifactory) {
|
|
344
|
-
return beforeEach(subject, this.initialValues, testResource, (fPath, value) =>
|
|
345
|
-
// TODO does not work?
|
|
346
|
-
artifactory(`beforeEach/${fPath}`, value));
|
|
347
|
-
}
|
|
348
|
-
afterEach(store, key, artifactory) {
|
|
349
|
-
return new Promise((res) => res(afterEach(store, key, (fPath, value) => artifactory(`after/${fPath}`, value))));
|
|
350
|
-
}
|
|
351
|
-
afterAll(store, artifactory) {
|
|
352
|
-
return afterAll(store, (fPath, value) =>
|
|
353
|
-
// TODO does not work?
|
|
354
|
-
artifactory(`afterAll4-${this.name}/${fPath}`, value));
|
|
355
|
-
}
|
|
356
|
-
}, class When extends BaseWhen {
|
|
357
|
-
constructor(name, actioner, payload) {
|
|
358
|
-
super(name, (store) => {
|
|
359
|
-
return actionHandler(actioner);
|
|
360
|
-
});
|
|
361
|
-
this.payload = payload;
|
|
362
|
-
}
|
|
363
|
-
async andWhen(store, actioner, testResource) {
|
|
364
|
-
return await andWhen(store, actioner, testResource);
|
|
365
|
-
}
|
|
366
|
-
}, class Then extends BaseThen {
|
|
367
|
-
constructor(name, callback) {
|
|
368
|
-
super(name, callback);
|
|
369
|
-
}
|
|
370
|
-
async butThen(store, testResourceConfiguration) {
|
|
371
|
-
return await butThen(store, this.thenCB, testResourceConfiguration);
|
|
372
|
-
}
|
|
373
|
-
}, class Check extends BaseCheck {
|
|
374
|
-
constructor(name, features, checkCallback, whens, thens, initialValues) {
|
|
375
|
-
super(name, features, checkCallback, whens, thens);
|
|
376
|
-
this.initialValues = initialValues;
|
|
377
|
-
}
|
|
378
|
-
async checkThat(subject, testResourceConfiguration, artifactory) {
|
|
379
|
-
return beforeEach(subject, this.initialValues, testResourceConfiguration, (fPath, value) => artifactory(`before/${fPath}`, value));
|
|
380
|
-
}
|
|
381
|
-
afterEach(store, key, artifactory) {
|
|
382
|
-
return new Promise((res) => res(afterEach(store, key, (fPath, value) =>
|
|
383
|
-
// TODO does not work?
|
|
384
|
-
artifactory(`afterEach2-${this.name}/${fPath}`, value))));
|
|
385
|
-
}
|
|
386
|
-
}, testResourceRequirement, logWriter);
|
|
387
|
-
}
|
|
388
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
// const TesterantoComponent = (testInput) => (props) => {
|
|
2
|
-
// const myContainer = useRef(null);
|
|
3
|
-
// useEffect(() => {
|
|
4
|
-
// console.log(
|
|
5
|
-
// "useeffectCalled"
|
|
6
|
-
// );
|
|
7
|
-
// props.done(myContainer.current);
|
|
8
|
-
// }, []);
|
|
9
|
-
// return React.createElement('div', { ref: myContainer }, testInput()); //testInput();
|
|
10
|
-
// };
|
|
11
|
-
export const testInterface = (testInput) => {
|
|
12
|
-
return {
|
|
13
|
-
beforeEach: async (x, ndx, testRsource, artificer) => {
|
|
14
|
-
return new Promise((resolve, rej) => {
|
|
15
|
-
resolve(testInput());
|
|
16
|
-
});
|
|
17
|
-
},
|
|
18
|
-
andWhen: function (s, actioner) {
|
|
19
|
-
return actioner()(s);
|
|
20
|
-
},
|
|
21
|
-
};
|
|
22
|
-
};
|