testeranto 0.70.0 → 0.74.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -18
- package/dist/common/Node.js +7 -34
- package/dist/common/PM/index.js +71 -0
- package/dist/common/PM/main.js +370 -0
- package/dist/common/PM/node.js +84 -0
- package/dist/common/PM/web.js +129 -0
- package/dist/common/Project.js +20 -2
- package/dist/common/Puppeteer.js +109 -0
- package/dist/common/Reporter.js +119 -0
- package/dist/common/Scheduler.js +1 -0
- package/dist/common/SubPackages/puppeteer.js +3 -1
- package/dist/common/SubPackages/react/jsx/index.js +14 -2
- package/dist/common/SubPackages/react-dom/component/web.js +98 -45
- package/dist/common/SubPackages/react-test-renderer/jsx/index.js +0 -1
- package/dist/common/Web.js +24 -44
- package/dist/common/esbuildConfigs/web.js +3 -1
- package/dist/common/lib/abstractBase.js +189 -41
- package/dist/common/lib/basebuilder.js +56 -29
- package/dist/common/lib/classBuilder.js +6 -2
- package/dist/common/lib/core.js +41 -45
- package/dist/common/lib/index.js +2 -1
- package/dist/common/preload.js +14 -18
- package/dist/common/tsconfig.common.tsbuildinfo +1 -1
- package/dist/module/Node.js +7 -34
- package/dist/module/PM/index.js +67 -0
- package/dist/module/PM/main.js +340 -0
- package/dist/module/PM/node.js +77 -0
- package/dist/module/PM/web.js +122 -0
- package/dist/module/Project.js +20 -2
- package/dist/module/Puppeteer.js +104 -0
- package/dist/module/Reporter.js +114 -0
- package/dist/module/Scheduler.js +1 -0
- package/dist/module/SubPackages/puppeteer.js +3 -1
- package/dist/module/SubPackages/react/jsx/index.js +11 -2
- package/dist/module/SubPackages/react/jsx/node.js +1 -1
- package/dist/module/SubPackages/react-dom/component/web.js +98 -45
- package/dist/module/SubPackages/react-test-renderer/jsx/index.js +0 -1
- package/dist/module/Web.js +24 -44
- package/dist/module/esbuildConfigs/web.js +3 -1
- package/dist/module/lib/abstractBase.js +189 -41
- package/dist/module/lib/basebuilder.js +56 -29
- package/dist/module/lib/classBuilder.js +6 -2
- package/dist/module/lib/core.js +41 -45
- package/dist/module/lib/index.js +2 -1
- package/dist/module/preload.js +15 -14
- package/dist/module/tsconfig.module.tsbuildinfo +1 -1
- package/dist/prebuild/Report.css +1616 -584
- package/dist/prebuild/Report.js +2635 -2506
- package/dist/types/PM/index.d.ts +19 -0
- package/dist/types/PM/main.d.ts +26 -0
- package/dist/types/PM/node.d.ts +25 -0
- package/dist/types/PM/web.d.ts +24 -0
- package/dist/types/Reporter.d.ts +1 -0
- package/dist/types/Scheduler.d.ts +0 -0
- package/dist/types/SubPackages/react/jsx/index.d.ts +2 -5
- package/dist/types/SubPackages/react-dom/component/web.d.ts +1 -1
- package/dist/types/lib/abstractBase.d.ts +13 -12
- package/dist/types/lib/basebuilder.d.ts +4 -2
- package/dist/types/lib/classBuilder.d.ts +2 -2
- package/dist/types/lib/core.d.ts +4 -4
- package/dist/types/lib/index.d.ts +6 -5
- package/dist/types/lib/types.d.ts +16 -24
- package/dist/types/preload.d.ts +0 -1
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/package.json +3 -5
- package/src/Node.ts +8 -47
- package/src/PM/index.ts +102 -0
- package/src/PM/main.ts +452 -0
- package/src/PM/node.ts +122 -0
- package/src/PM/web.ts +162 -0
- package/src/Project.ts +21 -2
- package/src/Puppeteer.ts +131 -0
- package/src/Report.tsx +160 -46
- package/src/Reporter.ts +134 -0
- package/src/Scheduler.ts +0 -0
- package/src/SubPackages/puppeteer.ts +3 -3
- package/src/SubPackages/react/jsx/index.ts +13 -3
- package/src/SubPackages/react/jsx/node.ts +5 -8
- package/src/SubPackages/react-dom/component/web.ts +126 -67
- package/src/SubPackages/react-test-renderer/jsx/index.ts +0 -1
- package/src/Web.ts +25 -69
- package/src/esbuildConfigs/web.ts +4 -2
- package/src/lib/abstractBase.ts +260 -65
- package/src/lib/basebuilder.ts +121 -100
- package/src/lib/classBuilder.ts +5 -4
- package/src/lib/core.ts +58 -59
- package/src/lib/index.ts +10 -9
- package/src/lib/types.ts +18 -27
- package/src/preload.ts +14 -14
- package/dist/common/NodeWriter.js +0 -54
- package/dist/common/electron.js +0 -266
- package/dist/module/NodeWriter.js +0 -48
- package/dist/module/electron.js +0 -261
- package/dist/types/NodeWriter.d.ts +0 -2
- package/src/NodeWriter.ts +0 -72
- package/src/electron.ts +0 -317
- package/yarn-error.log +0 -3144
- /package/dist/types/{electron.d.ts → Puppeteer.d.ts} +0 -0
package/src/Report.tsx
CHANGED
|
@@ -11,7 +11,7 @@ import { Sigma, RandomizeNodePositions, RelativeSize } from 'react-sigma';
|
|
|
11
11
|
import 'bootstrap/dist/css/bootstrap.min.css';
|
|
12
12
|
|
|
13
13
|
import { TesterantoFeatures } from "./Features.js";
|
|
14
|
-
import { ITestTypes } from "./lib/types.js";
|
|
14
|
+
import { IRunTime, ITestTypes } from "./lib/types.js";
|
|
15
15
|
|
|
16
16
|
type IGraphData = {
|
|
17
17
|
nodes: { id: string, label: string }[],
|
|
@@ -45,14 +45,34 @@ document.addEventListener("DOMContentLoaded", function () {
|
|
|
45
45
|
});
|
|
46
46
|
|
|
47
47
|
const Report = () => {
|
|
48
|
+
|
|
49
|
+
const [state, setState] = useState<{
|
|
50
|
+
tests: ITestTypes[],
|
|
51
|
+
buildDir: string,
|
|
52
|
+
features: TesterantoFeatures
|
|
53
|
+
results: any
|
|
54
|
+
}>({
|
|
55
|
+
tests: [],
|
|
56
|
+
buildDir: "",
|
|
57
|
+
features: new TesterantoFeatures({}, {
|
|
58
|
+
undirected: [],
|
|
59
|
+
directed: [],
|
|
60
|
+
dags: []
|
|
61
|
+
}),
|
|
62
|
+
results: {}
|
|
63
|
+
});
|
|
64
|
+
|
|
48
65
|
const [tests, setTests] = useState<
|
|
49
66
|
{
|
|
50
|
-
tests: ITestTypes[]
|
|
67
|
+
tests: ITestTypes[],
|
|
68
|
+
buildDir: string,
|
|
51
69
|
}
|
|
52
70
|
|
|
53
71
|
>({
|
|
54
|
-
tests: []
|
|
72
|
+
tests: [],
|
|
73
|
+
buildDir: ""
|
|
55
74
|
});
|
|
75
|
+
|
|
56
76
|
const [features, setFeatures] = useState<TesterantoFeatures>(
|
|
57
77
|
new TesterantoFeatures({}, {
|
|
58
78
|
undirected: [],
|
|
@@ -61,34 +81,102 @@ const Report = () => {
|
|
|
61
81
|
})
|
|
62
82
|
);
|
|
63
83
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
console.log("imported features", module.default);
|
|
68
|
-
setFeatures(module.default);
|
|
69
|
-
};
|
|
70
|
-
importFeatures();
|
|
71
|
-
}, []);
|
|
84
|
+
const [results, setResults] = useState<Record<string, { exitcode, log, testresults, manifest }>>(
|
|
85
|
+
{}
|
|
86
|
+
);
|
|
72
87
|
|
|
88
|
+
const importState = async () => {
|
|
89
|
+
const features = await import('features.test.js');
|
|
90
|
+
const config = await (await fetch("./testeranto.json")).json();
|
|
91
|
+
const results = await Promise.all(config.tests.map((test) => {
|
|
92
|
+
return new Promise(async (res, rej) => {
|
|
93
|
+
const src: string = test[0];
|
|
94
|
+
const runtime: IRunTime = test[1];
|
|
95
|
+
const s: string = [tests.buildDir, runtime as string].concat(src.split(".").slice(0, - 1).join(".")).join("/");
|
|
96
|
+
const exitcode = await (await fetch(config.buildDir + "/" + s + "/exitcode")).text()
|
|
97
|
+
const log = await (await fetch(config.buildDir + "/" + s + "/log.txt")).text()
|
|
98
|
+
const testresults = await (await fetch(config.buildDir + "/" + s + "/tests.json")).json()
|
|
99
|
+
const manifest = await (await fetch(config.buildDir + "/" + s + "/manifest.json")).json()
|
|
100
|
+
|
|
101
|
+
res({ src, exitcode, log, testresults, manifest })
|
|
102
|
+
})
|
|
103
|
+
}))
|
|
104
|
+
// const results = await config.tests.reduce(async (p, test) => {
|
|
105
|
+
// const src: string = test[0];
|
|
106
|
+
// const runtime: IRunTime = test[1];
|
|
107
|
+
// console.log(runtime)
|
|
108
|
+
// const s: string = [tests.buildDir, runtime as string].concat(src.split(".").slice(0, - 1).join(".")).join("/");
|
|
109
|
+
// // const srr
|
|
110
|
+
// console.log("s", s)
|
|
111
|
+
|
|
112
|
+
// const exitcode = await (await fetch(config.buildDir + "/" + s + "/exitcode")).text()
|
|
113
|
+
// const log = await (await fetch(config.buildDir + "/" + s + "/log.txt")).text()
|
|
114
|
+
// const testresults = await (await fetch(config.buildDir + "/" + s + "/tests.json")).text()
|
|
115
|
+
|
|
116
|
+
// // setResults({ src, exitcode, log, testresults })
|
|
117
|
+
// // console.log("a", await a.text())
|
|
118
|
+
// p[src] = { exitcode, log, testresults }
|
|
119
|
+
// return p
|
|
120
|
+
// }, {});
|
|
121
|
+
|
|
122
|
+
console.log("results", results)
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
setState({ tests: config.tests as any, results, features: features as any, buildDir: config.buildDir })
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
const importFeatures = async () => {
|
|
129
|
+
const module = await import('features.test.js');
|
|
130
|
+
setFeatures(module.default);
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
const importTests = async () => {
|
|
134
|
+
const x = await fetch("./testeranto.json")
|
|
135
|
+
const y = await x.json();
|
|
136
|
+
setTests(y as any);
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
useEffect(() => { importState(); }, []);
|
|
140
|
+
|
|
141
|
+
useEffect(() => { importFeatures(); }, []);
|
|
142
|
+
useEffect(() => { importTests(); }, []);
|
|
73
143
|
|
|
74
144
|
useEffect(() => {
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
|
|
145
|
+
const collateResults = async () => {
|
|
146
|
+
console.log("collating", tests, features);
|
|
147
|
+
const r = tests.tests.reduce(async (p, test) => {
|
|
148
|
+
const src: string = test[0];
|
|
149
|
+
const runtime: IRunTime = test[1];
|
|
150
|
+
console.log(runtime)
|
|
151
|
+
const s: string = [tests.buildDir, runtime as string].concat(src.split(".").slice(0, - 1).join(".")).join("/");
|
|
152
|
+
// const srr
|
|
153
|
+
// console.log(s)
|
|
154
|
+
|
|
155
|
+
const exitcode = await (await fetch(s + "/exitcode")).text()
|
|
156
|
+
const log = await (await fetch(s + "/log.txt")).text()
|
|
157
|
+
const testresults = await (await fetch(s + "/tests.json")).text()
|
|
158
|
+
|
|
159
|
+
// setResults({ src, exitcode, log, testresults })
|
|
160
|
+
// console.log("a", await a.text())
|
|
161
|
+
p[src] = { exitcode, log, testresults }
|
|
162
|
+
}, {});
|
|
163
|
+
|
|
164
|
+
setResults(r);
|
|
165
|
+
// const x = await fetch("./testeranto.json")
|
|
166
|
+
// const y = await x.json();
|
|
167
|
+
// setTests(y as any);
|
|
80
168
|
// const module = await import('tests.json', {
|
|
81
169
|
// with: {
|
|
82
170
|
// type: 'json'
|
|
83
171
|
// }
|
|
84
172
|
// });
|
|
85
173
|
// console.log("imported tests", module.default);
|
|
86
|
-
//
|
|
174
|
+
// setResults("foo");
|
|
87
175
|
};
|
|
88
|
-
|
|
89
|
-
importTests();
|
|
176
|
+
collateResults();
|
|
90
177
|
}, []);
|
|
91
178
|
|
|
179
|
+
console.log("state.results", state.results);
|
|
92
180
|
|
|
93
181
|
return (
|
|
94
182
|
<div>
|
|
@@ -96,6 +184,7 @@ const Report = () => {
|
|
|
96
184
|
{`
|
|
97
185
|
pre, code, p {
|
|
98
186
|
max-width: 30rem;
|
|
187
|
+
text-wrap: auto;
|
|
99
188
|
}
|
|
100
189
|
footer {
|
|
101
190
|
background-color: lightgray;
|
|
@@ -108,11 +197,16 @@ footer {
|
|
|
108
197
|
`}
|
|
109
198
|
</style>
|
|
110
199
|
|
|
111
|
-
{features && tests && < Tabs defaultActiveKey="
|
|
200
|
+
{features && tests && < Tabs defaultActiveKey="config" >
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
<Tab eventKey="config" title="config">
|
|
205
|
+
<pre>{JSON.stringify(state, null, 2)}</pre>
|
|
206
|
+
</Tab>
|
|
112
207
|
|
|
113
|
-
<Tab eventKey="
|
|
114
|
-
<pre>{JSON.stringify(
|
|
115
|
-
<pre>{JSON.stringify(tests, null, 2)}</pre>
|
|
208
|
+
<Tab eventKey="results" title="results">
|
|
209
|
+
<pre>{JSON.stringify(state.results, null, 2)}</pre>
|
|
116
210
|
</Tab>
|
|
117
211
|
|
|
118
212
|
<Tab eventKey="features" title="features">
|
|
@@ -168,7 +262,7 @@ footer {
|
|
|
168
262
|
</Tab>
|
|
169
263
|
|
|
170
264
|
<Tab eventKey="feature.tests" title="tests">
|
|
171
|
-
<pre id="theProps">{JSON.stringify(tests, null, 2)}</pre>
|
|
265
|
+
<pre id="theProps">{JSON.stringify(tests.tests, null, 2)}</pre>
|
|
172
266
|
</Tab>
|
|
173
267
|
</Tabs>
|
|
174
268
|
</Col>
|
|
@@ -221,7 +315,7 @@ footer {
|
|
|
221
315
|
</Tab>
|
|
222
316
|
|
|
223
317
|
<Tab eventKey="feature.tests" title="tests">
|
|
224
|
-
<pre id="theProps">{JSON.stringify(tests, null, 2)}</pre>
|
|
318
|
+
<pre id="theProps">{JSON.stringify(tests.tests, null, 2)}</pre>
|
|
225
319
|
</Tab>
|
|
226
320
|
</Tabs>
|
|
227
321
|
</Col>
|
|
@@ -270,7 +364,7 @@ footer {
|
|
|
270
364
|
</Tab>
|
|
271
365
|
|
|
272
366
|
<Tab eventKey="feature.tests" title="tests">
|
|
273
|
-
<pre id="theProps">{JSON.stringify(tests, null, 2)}</pre>
|
|
367
|
+
<pre id="theProps">{JSON.stringify(tests.tests, null, 2)}</pre>
|
|
274
368
|
</Tab>
|
|
275
369
|
</Tabs>
|
|
276
370
|
</Col>
|
|
@@ -317,7 +411,7 @@ footer {
|
|
|
317
411
|
</Tab>
|
|
318
412
|
|
|
319
413
|
<Tab eventKey="feature.tests" title="tests">
|
|
320
|
-
<pre id="theProps">{JSON.stringify(tests, null, 2)}</pre>
|
|
414
|
+
<pre id="theProps">{JSON.stringify(tests.tests, null, 2)}</pre>
|
|
321
415
|
</Tab>
|
|
322
416
|
</Tabs>
|
|
323
417
|
</Col>
|
|
@@ -332,33 +426,53 @@ footer {
|
|
|
332
426
|
</Tab.Container>
|
|
333
427
|
</Tab>
|
|
334
428
|
|
|
335
|
-
<Tab eventKey="
|
|
429
|
+
<Tab eventKey="tests" title="tests">
|
|
336
430
|
<Tab.Container id="left-tabs-example5" defaultActiveKey="feature-0">
|
|
337
431
|
<Row>
|
|
338
|
-
<Col sm={
|
|
432
|
+
<Col sm={4}>
|
|
339
433
|
{/* <Tree tests={features.tests} /> */}
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
434
|
+
<Nav variant="pills" className="flex-column">
|
|
435
|
+
{
|
|
436
|
+
tests.tests.map((t, ndx) =>
|
|
437
|
+
<Nav.Item key={ndx}>
|
|
438
|
+
<Nav.Link eventKey={`test-${ndx}`}>
|
|
439
|
+
{t[0]} - {t[1]}
|
|
440
|
+
</Nav.Link>
|
|
441
|
+
</Nav.Item>
|
|
442
|
+
)
|
|
443
|
+
}
|
|
444
|
+
</Nav>
|
|
351
445
|
</Col>
|
|
352
|
-
<Col sm={
|
|
446
|
+
<Col sm={4}>
|
|
353
447
|
<Tab.Content>
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
448
|
+
|
|
449
|
+
{
|
|
450
|
+
tests.tests.map((t, ndx) =>
|
|
451
|
+
<Tab.Pane eventKey={`test-${ndx}`}>
|
|
452
|
+
{/* <pre>{JSON.stringify(t, null, 2)}</pre> */}
|
|
453
|
+
{/* <pre>{JSON.stringify(state.results, null, 2)}</pre> */}
|
|
454
|
+
<pre>{JSON.stringify(Object.entries(state.results).filter(([k, v]: [string, { src: string }]) => {
|
|
455
|
+
console.log(v.src, tests.tests[ndx][0])
|
|
456
|
+
return v.src === tests.tests[ndx][0]
|
|
457
|
+
}), null, 2)}</pre>
|
|
458
|
+
|
|
459
|
+
{/* {tests.tests.map((t, ndx) => {
|
|
460
|
+
return (
|
|
461
|
+
<Tab.Pane eventKey={`feature-${ndx}`} key={ndx}>
|
|
462
|
+
<pre>{JSON.stringify(t, null, 2)}</pre>
|
|
463
|
+
</Tab.Pane>
|
|
464
|
+
)
|
|
465
|
+
}
|
|
466
|
+
)} */}
|
|
467
|
+
|
|
358
468
|
</Tab.Pane>
|
|
469
|
+
|
|
359
470
|
)
|
|
360
471
|
}
|
|
361
|
-
|
|
472
|
+
|
|
473
|
+
|
|
474
|
+
|
|
475
|
+
|
|
362
476
|
</Tab.Content>
|
|
363
477
|
</Col>
|
|
364
478
|
|
package/src/Reporter.ts
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import readline from "readline";
|
|
2
|
+
import fs from "fs";
|
|
3
|
+
import { jsonc } from "jsonc";
|
|
4
|
+
import puppeteer from "puppeteer-core";
|
|
5
|
+
|
|
6
|
+
import { IBuiltConfig, IRunTime } from "./lib/types";
|
|
7
|
+
|
|
8
|
+
// import { PM_Main } from "./PM/main.js";
|
|
9
|
+
|
|
10
|
+
// var mode: "DEV" | "PROD" = process.argv[2] === "-dev" ? "DEV" : "PROD";
|
|
11
|
+
|
|
12
|
+
// const node2web: Record<string, string[]> = {};
|
|
13
|
+
// const web2node: Record<string, string[]> = {};
|
|
14
|
+
// const childProcesses: Record<string, "loaded" | "running" | "done"> = {};
|
|
15
|
+
|
|
16
|
+
readline.emitKeypressEvents(process.stdin);
|
|
17
|
+
if (process.stdin.isTTY) process.stdin.setRawMode(true);
|
|
18
|
+
|
|
19
|
+
console.log("\n Puppeteer is running. Press 'q' to quit\n");
|
|
20
|
+
process.stdin.on("keypress", (str, key) => {
|
|
21
|
+
if (key.name === "q") {
|
|
22
|
+
process.exit();
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
const main = async () => {
|
|
27
|
+
const configs = jsonc.parse(
|
|
28
|
+
(await fs.readFileSync("./docs/testeranto.json")).toString()
|
|
29
|
+
) as IBuiltConfig;
|
|
30
|
+
|
|
31
|
+
// const pm = new PM_Main(configs);
|
|
32
|
+
|
|
33
|
+
// await puppeteer.launch(options);
|
|
34
|
+
const browser = await puppeteer.launch(
|
|
35
|
+
{
|
|
36
|
+
waitForInitialPage: false,
|
|
37
|
+
executablePath: "/opt/homebrew/bin/chromium",
|
|
38
|
+
headless: false,
|
|
39
|
+
args: [
|
|
40
|
+
"--allow-file-access-from-files",
|
|
41
|
+
"--allow-running-insecure-content",
|
|
42
|
+
// "--auto-open-devtools-for-tabs",
|
|
43
|
+
"--disable-dev-shm-usage",
|
|
44
|
+
"--disable-extensions",
|
|
45
|
+
"--disable-gpu",
|
|
46
|
+
"--disable-setuid-sandbox",
|
|
47
|
+
"--disable-site-isolation-trials",
|
|
48
|
+
"--disable-web-security",
|
|
49
|
+
"--disable-web-security",
|
|
50
|
+
"--no-first-run",
|
|
51
|
+
"--no-sandbox",
|
|
52
|
+
"--no-startup-window",
|
|
53
|
+
"--no-zygote",
|
|
54
|
+
"--reduce-security-for-testing",
|
|
55
|
+
"--remote-allow-origins=*",
|
|
56
|
+
// "--remote-allow-origins=ws://localhost:3234",
|
|
57
|
+
"--unsafely-treat-insecure-origin-as-secure=*",
|
|
58
|
+
// "--disable-features=IsolateOrigins",
|
|
59
|
+
// "--single-process",
|
|
60
|
+
// "--unsafely-treat-insecure-origin-as-secure",
|
|
61
|
+
// "--unsafely-treat-insecure-origin-as-secure=ws://192.168.0.101:3234",
|
|
62
|
+
// `--remote-debugging-port=3234`,
|
|
63
|
+
],
|
|
64
|
+
}
|
|
65
|
+
// "."
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
console.log("Creating new page...");
|
|
69
|
+
const page = await browser.newPage();
|
|
70
|
+
|
|
71
|
+
await page.setViewport({ width: 0, height: 0 });
|
|
72
|
+
|
|
73
|
+
console.log("Requesting url...");
|
|
74
|
+
await page.goto(`file://${process.cwd()}/docs/report.html`);
|
|
75
|
+
|
|
76
|
+
// const destinationOfRuntime = (f: string, r: IRunTime) => {
|
|
77
|
+
// return path
|
|
78
|
+
// .normalize(`${configs.buildDir}/${r}/${f}`)
|
|
79
|
+
// .split(".")
|
|
80
|
+
// .slice(0, -1)
|
|
81
|
+
// .join(".");
|
|
82
|
+
// };
|
|
83
|
+
|
|
84
|
+
// configs.tests.forEach(([test, runtime, secondaryArtifacts]) => {
|
|
85
|
+
// if (runtime === "node") {
|
|
86
|
+
// pm.launchNode(test, destinationOfRuntime(test, "node"));
|
|
87
|
+
// } else if (runtime === "web") {
|
|
88
|
+
// pm.launchWeb(test, destinationOfRuntime(test, "web"));
|
|
89
|
+
// } else {
|
|
90
|
+
// console.error("runtime makes no sense", runtime);
|
|
91
|
+
// }
|
|
92
|
+
// });
|
|
93
|
+
|
|
94
|
+
// console.log("ready and watching for changes...", configs.buildDir);
|
|
95
|
+
// fs.watch(
|
|
96
|
+
// configs.buildDir,
|
|
97
|
+
// {
|
|
98
|
+
// recursive: true,
|
|
99
|
+
// },
|
|
100
|
+
// (eventType, changedFile) => {
|
|
101
|
+
// if (changedFile) {
|
|
102
|
+
// configs.tests.forEach(([test, runtime, secondaryArtifacts]) => {
|
|
103
|
+
// if (eventType === "change" || eventType === "rename") {
|
|
104
|
+
// if (
|
|
105
|
+
// changedFile ===
|
|
106
|
+
// test
|
|
107
|
+
// .replace("./", "node/")
|
|
108
|
+
// .split(".")
|
|
109
|
+
// .slice(0, -1)
|
|
110
|
+
// .concat("mjs")
|
|
111
|
+
// .join(".")
|
|
112
|
+
// ) {
|
|
113
|
+
// pm.launchNode(test, destinationOfRuntime(test, "node"));
|
|
114
|
+
// }
|
|
115
|
+
|
|
116
|
+
// if (
|
|
117
|
+
// changedFile ===
|
|
118
|
+
// test
|
|
119
|
+
// .replace("./", "web/")
|
|
120
|
+
// .split(".")
|
|
121
|
+
// .slice(0, -1)
|
|
122
|
+
// .concat("mjs")
|
|
123
|
+
// .join(".")
|
|
124
|
+
// ) {
|
|
125
|
+
// pm.launchWeb(test, destinationOfRuntime(test, "web"));
|
|
126
|
+
// }
|
|
127
|
+
// }
|
|
128
|
+
// });
|
|
129
|
+
// }
|
|
130
|
+
// }
|
|
131
|
+
// );
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
main();
|
package/src/Scheduler.ts
ADDED
|
File without changes
|
|
@@ -30,9 +30,9 @@ export default <ITestShape extends IBaseTest>(
|
|
|
30
30
|
testImplementations,
|
|
31
31
|
{
|
|
32
32
|
beforeAll(x) {
|
|
33
|
-
process.parentPort.postMessage(
|
|
34
|
-
|
|
35
|
-
);
|
|
33
|
+
// process.parentPort.postMessage(
|
|
34
|
+
// `/docs/web/src/ClassicalComponent/test.html`
|
|
35
|
+
// );
|
|
36
36
|
|
|
37
37
|
return x;
|
|
38
38
|
},
|
|
@@ -2,9 +2,11 @@ import { CElement } from "react";
|
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
4
|
IBaseTest,
|
|
5
|
+
IPartialInterface,
|
|
5
6
|
ITestImplementation,
|
|
6
7
|
ITestSpecification,
|
|
7
8
|
} from "../../../Types";
|
|
9
|
+
import React from "react";
|
|
8
10
|
|
|
9
11
|
export type IWhenShape = any;
|
|
10
12
|
export type IThenShape = any;
|
|
@@ -20,10 +22,18 @@ export type ITestImpl<ITestShape extends IBaseTest> =
|
|
|
20
22
|
export type ITestSpec<ITestShape extends IBaseTest> =
|
|
21
23
|
ITestSpecification<ITestShape>;
|
|
22
24
|
|
|
23
|
-
export const testInterface = {
|
|
24
|
-
|
|
25
|
+
export const testInterface: IPartialInterface<any> = {
|
|
26
|
+
// beforeAll: async (proto, testResource, artificer, pm): Promise<IStore> => {
|
|
27
|
+
// return React.createElement(proto);
|
|
28
|
+
// // return new Promise((resolve, rej) => {
|
|
29
|
+
// // resolve(x());
|
|
30
|
+
// // });
|
|
31
|
+
// },
|
|
32
|
+
beforeEach: async (subject, initializer, artificer): Promise<IStore> => {
|
|
25
33
|
return new Promise((resolve, rej) => {
|
|
26
|
-
|
|
34
|
+
const x = React.createElement(subject);
|
|
35
|
+
console.log("react-element", x);
|
|
36
|
+
resolve(x);
|
|
27
37
|
});
|
|
28
38
|
},
|
|
29
39
|
andWhen: function (s: IStore, whenCB): Promise<ISelection> {
|
|
@@ -5,25 +5,22 @@ import {
|
|
|
5
5
|
ITestImpl,
|
|
6
6
|
ITestSpec,
|
|
7
7
|
IInput,
|
|
8
|
-
|
|
9
|
-
testInterface as baseInterface
|
|
8
|
+
testInterface as baseInterface,
|
|
10
9
|
} from "./index.js";
|
|
11
10
|
|
|
12
11
|
export default <ITestShape extends IBaseTest>(
|
|
13
12
|
testImplementations: ITestImpl<ITestShape>,
|
|
14
13
|
testSpecifications: ITestSpec<ITestShape>,
|
|
15
14
|
testInput: IInput,
|
|
16
|
-
testInterface: IPartialInterface<ITestShape
|
|
15
|
+
testInterface: IPartialInterface<ITestShape>
|
|
17
16
|
) => {
|
|
18
|
-
return Testeranto<
|
|
19
|
-
ITestShape
|
|
20
|
-
>(
|
|
17
|
+
return Testeranto<ITestShape>(
|
|
21
18
|
testInput,
|
|
22
19
|
testSpecifications,
|
|
23
20
|
testImplementations,
|
|
24
21
|
{
|
|
25
22
|
...baseInterface,
|
|
26
|
-
...testInterface
|
|
23
|
+
...testInterface,
|
|
27
24
|
}
|
|
28
|
-
)
|
|
25
|
+
);
|
|
29
26
|
};
|