testeranto 0.94.0 → 0.100.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/bundle.js +4 -7
- package/dist/common/src/PM/main.js +160 -42
- package/dist/common/src/PM/node.js +20 -5
- package/dist/common/src/PM/web.js +19 -4
- package/dist/common/src/SubPackages/react/jsx/node.js +1 -6
- package/dist/common/src/cli.js +439 -0
- package/dist/common/src/cli2.js +144 -0
- package/dist/common/src/esbuildConfigs/inputFilesPlugin.js +18 -6
- package/dist/common/src/esbuildConfigs/node.js +1 -4
- package/dist/common/src/esbuildConfigs/web.js +1 -1
- package/dist/common/src/lib/abstractBase.js +14 -91
- package/dist/common/src/lib/types.js +1 -0
- package/dist/common/tsconfig.common.tsbuildinfo +1 -1
- package/dist/module/src/PM/main.js +160 -42
- package/dist/module/src/PM/node.js +20 -5
- package/dist/module/src/PM/web.js +19 -4
- package/dist/module/src/SubPackages/react/jsx/node.js +1 -6
- package/dist/module/src/cli.js +411 -0
- package/dist/module/src/cli2.js +116 -0
- package/dist/module/src/esbuildConfigs/inputFilesPlugin.js +18 -6
- package/dist/module/src/esbuildConfigs/node.js +1 -4
- package/dist/module/src/esbuildConfigs/web.js +1 -1
- package/dist/module/src/lib/abstractBase.js +14 -91
- package/dist/module/src/lib/types.js +1 -0
- package/dist/module/tsconfig.module.tsbuildinfo +1 -1
- package/dist/prebuild/cli.mjs +1491 -0
- package/dist/prebuild/{run-tests.mjs → cli2.mjs} +203 -156
- package/dist/types/src/Node.d.ts +2 -2
- package/dist/types/src/PM/index.d.ts +10 -2
- package/dist/types/src/PM/main.d.ts +13 -7
- package/dist/types/src/PM/node.d.ts +9 -2
- package/dist/types/src/PM/web.d.ts +9 -3
- package/dist/types/src/SubPackages/puppeteer.d.ts +1 -1
- package/dist/types/src/SubPackages/react/component/node.d.ts +1 -1
- package/dist/types/src/SubPackages/react/component/web.d.ts +1 -1
- package/dist/types/src/SubPackages/react/jsx/node.d.ts +3 -3
- package/dist/types/src/SubPackages/react/jsx/web.d.ts +2 -2
- package/dist/types/src/SubPackages/react-dom/component/node.d.ts +2 -2
- package/dist/types/src/SubPackages/react-dom/component/web.d.ts +1 -1
- package/dist/types/src/SubPackages/react-dom/jsx/node.d.ts +1 -1
- package/dist/types/src/SubPackages/react-dom/jsx/web.d.ts +2 -2
- package/dist/types/src/SubPackages/react-test-renderer/MemoExoticComponent/node.d.ts +2 -2
- package/dist/types/src/SubPackages/react-test-renderer/component/node.d.ts +2 -2
- package/dist/types/src/SubPackages/react-test-renderer/component/web.d.ts +2 -2
- package/dist/types/src/SubPackages/react-test-renderer/fc/node.d.ts +2 -2
- package/dist/types/src/SubPackages/react-test-renderer/fc/web.d.ts +2 -2
- package/dist/types/src/SubPackages/react-test-renderer/jsx/node.d.ts +3 -2
- package/dist/types/src/SubPackages/react-test-renderer/jsx/web.d.ts +2 -2
- package/dist/types/src/SubPackages/react-test-renderer/jsx-promised/node.d.ts +2 -2
- package/dist/types/src/SubPackages/react-test-renderer/jsx-promised/web.d.ts +2 -2
- package/dist/types/src/Types.d.ts +60 -21
- package/dist/types/src/Web.d.ts +2 -2
- package/dist/types/src/lib/index.d.ts +1 -1
- package/dist/types/src/lib/types.d.ts +2 -30
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/package.json +11 -8
- package/src/PM/index.ts +12 -8
- package/src/PM/main.ts +218 -62
- package/src/PM/node.ts +42 -7
- package/src/PM/web.ts +33 -5
- package/src/SubPackages/react/jsx/node.ts +16 -5
- package/src/SubPackages/react-test-renderer/jsx/node.ts +16 -1
- package/src/Types.ts +362 -114
- package/src/cli.ts +535 -0
- package/src/cli2.ts +157 -0
- package/src/esbuildConfigs/inputFilesPlugin.ts +27 -6
- package/src/esbuildConfigs/node.ts +4 -7
- package/src/esbuildConfigs/web.ts +4 -3
- package/src/lib/abstractBase.ts +58 -115
- package/src/lib/types.ts +3 -177
- package/dist/common/src/Aider.js +0 -143
- package/dist/common/src/Project.js +0 -227
- package/dist/common/src/Puppeteer.js +0 -111
- package/dist/common/src/build-tests.js +0 -39
- package/dist/common/src/esbuildConfigs/features.js +0 -14
- package/dist/common/src/esbuildConfigs/report.js +0 -14
- package/dist/common/src/esbuildConfigs/tests.js +0 -13
- package/dist/common/src/run-tests.js +0 -39
- package/dist/module/src/Aider.js +0 -136
- package/dist/module/src/Project.js +0 -220
- package/dist/module/src/Puppeteer.js +0 -106
- package/dist/module/src/build-tests.js +0 -11
- package/dist/module/src/esbuildConfigs/features.js +0 -12
- package/dist/module/src/esbuildConfigs/report.js +0 -14
- package/dist/module/src/esbuildConfigs/tests.js +0 -11
- package/dist/module/src/run-tests.js +0 -11
- package/dist/prebuild/build-tests.mjs +0 -553
- package/dist/types/src/Aider.d.ts +0 -1
- package/dist/types/src/Project.d.ts +0 -12
- package/dist/types/src/Puppeteer.d.ts +0 -2
- package/dist/types/src/esbuildConfigs/features.d.ts +0 -4
- package/dist/types/src/esbuildConfigs/report.d.ts +0 -0
- package/dist/types/src/esbuildConfigs/tests.d.ts +0 -4
- package/src/Aider.ts +0 -168
- package/src/Project.ts +0 -292
- package/src/Puppeteer.ts +0 -143
- package/src/build-tests.ts +0 -12
- package/src/esbuildConfigs/features.ts +0 -17
- package/src/esbuildConfigs/report.ts +0 -15
- package/src/esbuildConfigs/tests.ts +0 -14
- package/src/run-tests.ts +0 -12
- /package/dist/types/src/{build-tests.d.ts → cli.d.ts} +0 -0
- /package/dist/types/src/{run-tests.d.ts → cli2.d.ts} +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import fs from "fs";
|
|
2
2
|
import path from "path";
|
|
3
3
|
import type { ImportKind, Metafile, Plugin } from "esbuild";
|
|
4
|
+
import { spawn } from "child_process";
|
|
4
5
|
|
|
5
6
|
const otherInputs: Record<string, Set<string>> = {};
|
|
6
7
|
|
|
@@ -108,6 +109,12 @@ export default (
|
|
|
108
109
|
(t) => `docs/types/${t}.type_errors.txt`
|
|
109
110
|
);
|
|
110
111
|
|
|
112
|
+
const lintPath = path.join(
|
|
113
|
+
"./docs/",
|
|
114
|
+
platform,
|
|
115
|
+
entryPoint.split(".").slice(0, -1).join("."),
|
|
116
|
+
`lint_errors.txt`
|
|
117
|
+
);
|
|
111
118
|
fs.writeFileSync(
|
|
112
119
|
promptPath,
|
|
113
120
|
`
|
|
@@ -119,14 +126,11 @@ ${addableFiles
|
|
|
119
126
|
|
|
120
127
|
${typeErrorFiles
|
|
121
128
|
.map((x) => {
|
|
122
|
-
// const f = `docs/types/${x}.type_errors.txt`;
|
|
123
129
|
return `/read ${x}`;
|
|
124
|
-
// if (fs.existsSync(f)) {
|
|
125
|
-
// return `/read ${f}`;
|
|
126
|
-
// }
|
|
127
130
|
})
|
|
128
131
|
.join("\n")}
|
|
129
|
-
|
|
132
|
+
|
|
133
|
+
/read ${lintPath}
|
|
130
134
|
/read ${testPaths}
|
|
131
135
|
/read ${stdoutPath}
|
|
132
136
|
/read ${stderrPath}
|
|
@@ -135,9 +139,26 @@ ${typeErrorFiles
|
|
|
135
139
|
|
|
136
140
|
/code Fix the failing tests described in ${testPaths}. Correct any type signature errors described in the files [${typeErrorFiles.join(
|
|
137
141
|
", "
|
|
138
|
-
)}]. Implement any method which throws "Function not implemented."
|
|
142
|
+
)}]. Implement any method which throws "Function not implemented. Resolve the lint errors described in ${lintPath}"
|
|
139
143
|
`
|
|
140
144
|
);
|
|
145
|
+
|
|
146
|
+
const logContent: string[] = [];
|
|
147
|
+
const tsc = spawn("eslint", addableFiles);
|
|
148
|
+
|
|
149
|
+
tsc.stdout.on("data", (data) => {
|
|
150
|
+
const lines = data.toString().split("\n");
|
|
151
|
+
logContent.push(...lines);
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
tsc.stderr.on("data", (data) => {
|
|
155
|
+
console.error(`stderr: ${data}`);
|
|
156
|
+
process.exit(-1);
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
tsc.on("close", (code) => {
|
|
160
|
+
fs.writeFileSync(lintPath, logContent.join("\n"));
|
|
161
|
+
});
|
|
141
162
|
}
|
|
142
163
|
});
|
|
143
164
|
}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { BuildOptions } from "esbuild";
|
|
2
|
-
// import pkg from "esbuild-plugin-markdown";
|
|
3
|
-
// const { markdownPlugin } = pkg;
|
|
4
2
|
|
|
5
3
|
import { IBaseConfig } from "../lib/types";
|
|
6
4
|
|
|
@@ -16,9 +14,6 @@ export default (
|
|
|
16
14
|
"node",
|
|
17
15
|
entryPoints
|
|
18
16
|
);
|
|
19
|
-
// const inputFilesPluginFactory = inputFilesPlugin("node", entryPoints);
|
|
20
|
-
// const register = (x) => x;
|
|
21
|
-
|
|
22
17
|
return {
|
|
23
18
|
...baseEsBuildConfig(config),
|
|
24
19
|
|
|
@@ -53,7 +48,7 @@ export default (
|
|
|
53
48
|
entryPoints: [...entryPoints],
|
|
54
49
|
plugins: [
|
|
55
50
|
featuresPlugin,
|
|
56
|
-
|
|
51
|
+
|
|
57
52
|
...(config.nodePlugins.map((p) => p(register, entryPoints)) || []),
|
|
58
53
|
|
|
59
54
|
inputFilesPluginFactory,
|
|
@@ -63,7 +58,9 @@ export default (
|
|
|
63
58
|
name: "rebuild-notify",
|
|
64
59
|
setup(build) {
|
|
65
60
|
build.onEnd((result) => {
|
|
66
|
-
console.log(
|
|
61
|
+
console.log(
|
|
62
|
+
`> node build ended with ${result.errors.length} errors`
|
|
63
|
+
);
|
|
67
64
|
if (result.errors.length > 0) {
|
|
68
65
|
console.log(result);
|
|
69
66
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { BuildOptions } from "esbuild";
|
|
2
2
|
import path from "path";
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
// const { markdownPlugin } = pkg;
|
|
4
|
+
import pkg from "esbuild-plugin-markdown";
|
|
6
5
|
|
|
7
6
|
import { IBaseConfig } from "../lib/types.js";
|
|
8
7
|
|
|
@@ -77,7 +76,9 @@ export default (
|
|
|
77
76
|
name: "rebuild-notify",
|
|
78
77
|
setup(build) {
|
|
79
78
|
build.onEnd((result) => {
|
|
80
|
-
console.log(
|
|
79
|
+
console.log(
|
|
80
|
+
`> web build ended with ${result.errors.length} errors`
|
|
81
|
+
);
|
|
81
82
|
if (result.errors.length > 0) {
|
|
82
83
|
console.log(result);
|
|
83
84
|
}
|
package/src/lib/abstractBase.ts
CHANGED
|
@@ -122,12 +122,15 @@ export abstract class BaseSuite<
|
|
|
122
122
|
const beforeAllProxy = new Proxy(pm, {
|
|
123
123
|
get(target, prop, receiver) {
|
|
124
124
|
if (prop === "customScreenShot") {
|
|
125
|
-
return (opts) =>
|
|
126
|
-
target.customScreenShot(
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
125
|
+
return (opts, p) =>
|
|
126
|
+
target.customScreenShot(
|
|
127
|
+
{
|
|
128
|
+
...opts,
|
|
129
|
+
// path: `${filepath}/${opts.path}`,
|
|
130
|
+
path: `suite-${sNdx}/beforeAll/${opts.path}`,
|
|
131
|
+
},
|
|
132
|
+
p
|
|
133
|
+
);
|
|
131
134
|
}
|
|
132
135
|
|
|
133
136
|
if (prop === "writeFileSync") {
|
|
@@ -309,11 +312,12 @@ export abstract class BaseGiven<
|
|
|
309
312
|
suiteNdx: number
|
|
310
313
|
) {
|
|
311
314
|
this.key = key;
|
|
315
|
+
|
|
312
316
|
tLog(`\n ${this.key}`);
|
|
313
317
|
tLog(`\n Given: ${this.name}`);
|
|
314
318
|
|
|
315
319
|
const givenArtifactory = (fPath: string, value: unknown) =>
|
|
316
|
-
artifactory(`given-${
|
|
320
|
+
artifactory(`given-${key}/${fPath}`, value);
|
|
317
321
|
try {
|
|
318
322
|
// tLog(`\n Given this.store`, this.store);
|
|
319
323
|
|
|
@@ -322,17 +326,31 @@ export abstract class BaseGiven<
|
|
|
322
326
|
if (prop === "writeFileSync") {
|
|
323
327
|
return (fp, contents) =>
|
|
324
328
|
target[prop](
|
|
325
|
-
`suite-${suiteNdx}/given-${
|
|
329
|
+
`suite-${suiteNdx}/given-${key}/when/beforeEach/${fp}`,
|
|
326
330
|
contents
|
|
327
331
|
);
|
|
328
332
|
}
|
|
329
333
|
|
|
330
334
|
if (prop === "customScreenShot") {
|
|
331
|
-
return (opts) =>
|
|
332
|
-
target.customScreenShot(
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
335
|
+
return (opts, p) =>
|
|
336
|
+
target.customScreenShot(
|
|
337
|
+
{
|
|
338
|
+
...opts,
|
|
339
|
+
path: `suite-${suiteNdx}/given-${key}/when/beforeEach/${opts.path}`,
|
|
340
|
+
},
|
|
341
|
+
p
|
|
342
|
+
);
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
if (prop === "screencast") {
|
|
346
|
+
return (opts, p) =>
|
|
347
|
+
target.screencast(
|
|
348
|
+
{
|
|
349
|
+
...opts,
|
|
350
|
+
path: `suite-${suiteNdx}/given-${key}/when/beforeEach/${opts.path}`,
|
|
351
|
+
},
|
|
352
|
+
p
|
|
353
|
+
);
|
|
336
354
|
}
|
|
337
355
|
|
|
338
356
|
return Reflect.get(...arguments);
|
|
@@ -360,7 +378,7 @@ export abstract class BaseGiven<
|
|
|
360
378
|
testResourceConfiguration,
|
|
361
379
|
tLog,
|
|
362
380
|
pm,
|
|
363
|
-
`suite-${suiteNdx}/given-${
|
|
381
|
+
`suite-${suiteNdx}/given-${key}/when/${whenNdx}`
|
|
364
382
|
);
|
|
365
383
|
}
|
|
366
384
|
|
|
@@ -370,7 +388,7 @@ export abstract class BaseGiven<
|
|
|
370
388
|
testResourceConfiguration,
|
|
371
389
|
tLog,
|
|
372
390
|
pm,
|
|
373
|
-
`suite-${suiteNdx}/given-${
|
|
391
|
+
`suite-${suiteNdx}/given-${key}/then-${thenNdx}`
|
|
374
392
|
);
|
|
375
393
|
tester(t);
|
|
376
394
|
}
|
|
@@ -386,17 +404,20 @@ export abstract class BaseGiven<
|
|
|
386
404
|
const afterEachProxy = new Proxy(pm, {
|
|
387
405
|
get(target, prop, receiver) {
|
|
388
406
|
if (prop === "customScreenShot") {
|
|
389
|
-
return (opts) =>
|
|
390
|
-
target.customScreenShot(
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
407
|
+
return (opts, p) =>
|
|
408
|
+
target.customScreenShot(
|
|
409
|
+
{
|
|
410
|
+
...opts,
|
|
411
|
+
path: `suite-${suiteNdx}/given-${key}/afterEach/${opts.path}`,
|
|
412
|
+
},
|
|
413
|
+
p
|
|
414
|
+
);
|
|
394
415
|
}
|
|
395
416
|
|
|
396
417
|
if (prop === "writeFileSync") {
|
|
397
418
|
return (fp, contents) =>
|
|
398
419
|
target[prop](
|
|
399
|
-
`suite-${suiteNdx}/given-${
|
|
420
|
+
`suite-${suiteNdx}/given-${key}/afterEach/${fp}`,
|
|
400
421
|
contents
|
|
401
422
|
);
|
|
402
423
|
}
|
|
@@ -460,101 +481,20 @@ export abstract class BaseWhen<ITestShape extends IBaseTest> {
|
|
|
460
481
|
const andWhenProxy = new Proxy(pm, {
|
|
461
482
|
get(target, prop, receiver) {
|
|
462
483
|
if (prop === "customScreenShot") {
|
|
463
|
-
return (opts) =>
|
|
464
|
-
target.customScreenShot(
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
484
|
+
return (opts, p) =>
|
|
485
|
+
target.customScreenShot(
|
|
486
|
+
{
|
|
487
|
+
...opts,
|
|
488
|
+
path: `${filepath}/${opts.path}`,
|
|
489
|
+
},
|
|
490
|
+
p
|
|
491
|
+
);
|
|
468
492
|
}
|
|
469
493
|
if (prop === "writeFileSync") {
|
|
470
494
|
return (fp, contents) =>
|
|
471
495
|
target[prop](`${filepath}/andWhen/${fp}`, contents);
|
|
472
496
|
}
|
|
473
497
|
|
|
474
|
-
/////////////////////
|
|
475
|
-
|
|
476
|
-
// if (prop === "browser") {
|
|
477
|
-
// return new Proxy(target[prop], {
|
|
478
|
-
// get(bTarget, bProp, bReceiver) {
|
|
479
|
-
// if (bProp === "pages") {
|
|
480
|
-
// return async () => {
|
|
481
|
-
// return bTarget.pages().then((pages) => {
|
|
482
|
-
// return pages.map((page) => {
|
|
483
|
-
// return new Proxy(page, {
|
|
484
|
-
// get(pTarget, pProp, pReciever) {
|
|
485
|
-
// // console.log("mark get", pTarget, pProp, pReciever);
|
|
486
|
-
// if (pProp === "screenshot") {
|
|
487
|
-
// return async (x) => {
|
|
488
|
-
// return pm.customScreenShot(
|
|
489
|
-
// {
|
|
490
|
-
// ...x,
|
|
491
|
-
// path:
|
|
492
|
-
// `${testResourceConfiguration.fs}/${key}/afterEach` +
|
|
493
|
-
// "/" +
|
|
494
|
-
// x.path,
|
|
495
|
-
// },
|
|
496
|
-
// page
|
|
497
|
-
// );
|
|
498
|
-
// };
|
|
499
|
-
// } else if (pProp === "mainFrame") {
|
|
500
|
-
// return () => pTarget[pProp]();
|
|
501
|
-
// // return target[pProp];
|
|
502
|
-
// // return Reflect.get(...arguments);
|
|
503
|
-
// } else if (pProp === "exposeFunction") {
|
|
504
|
-
// // return Reflect.get(target, prop, receiver);
|
|
505
|
-
// return pTarget[pProp].bind(pTarget);
|
|
506
|
-
// // return target[pProp];
|
|
507
|
-
// } else if (pProp === "removeExposedFunction") {
|
|
508
|
-
// // return Reflect.get(target, prop, receiver);
|
|
509
|
-
// return pTarget[pProp].bind(pTarget);
|
|
510
|
-
// // return target[pProp];
|
|
511
|
-
// } else if (pProp === "click") {
|
|
512
|
-
// // console.log("mark12", arguments);
|
|
513
|
-
// // return Reflect.get(target, prop, receiver);
|
|
514
|
-
// // return pTarget[pProp].bind(pTarget);
|
|
515
|
-
// // return target[pProp];
|
|
516
|
-
// return (selector, options) => {
|
|
517
|
-
// pTarget[pProp](selector, options);
|
|
518
|
-
// };
|
|
519
|
-
// } else if (pProp === "$eval") {
|
|
520
|
-
// // return pTarget[pProp].bind(pTarget);
|
|
521
|
-
// return (selector, options) => {
|
|
522
|
-
// pTarget[pProp](selector, options);
|
|
523
|
-
// };
|
|
524
|
-
// } else if (pProp === "$") {
|
|
525
|
-
// return Reflect.get(...arguments);
|
|
526
|
-
// // return Reflect.get(target, prop, receiver);
|
|
527
|
-
// // return pTarget[pProp].bind(pTarget);
|
|
528
|
-
// // return target[pProp];
|
|
529
|
-
// // return pTarget[pProp].bind(pTarget);
|
|
530
|
-
|
|
531
|
-
// // return async (s) => {
|
|
532
|
-
// // console.log("mark17", s);
|
|
533
|
-
// // console.log("pTarget", pTarget);
|
|
534
|
-
// // console.log("pProp", pProp);
|
|
535
|
-
// // console.log("pReciever", pReciever);
|
|
536
|
-
// // // return "XXX";
|
|
537
|
-
// // // debugger;
|
|
538
|
-
// // return await pTarget[pProp](s);
|
|
539
|
-
// // };
|
|
540
|
-
// } else {
|
|
541
|
-
// return Reflect.get(...arguments);
|
|
542
|
-
// }
|
|
543
|
-
// },
|
|
544
|
-
// });
|
|
545
|
-
// });
|
|
546
|
-
// });
|
|
547
|
-
// // return (await target.pages()).map((page) => {
|
|
548
|
-
// // return new Proxy(page, handler2);
|
|
549
|
-
// // });
|
|
550
|
-
// };
|
|
551
|
-
// }
|
|
552
|
-
// },
|
|
553
|
-
// });
|
|
554
|
-
// }
|
|
555
|
-
|
|
556
|
-
///////////////////////
|
|
557
|
-
|
|
558
498
|
return Reflect.get(...arguments);
|
|
559
499
|
},
|
|
560
500
|
});
|
|
@@ -637,11 +577,14 @@ export abstract class BaseThen<
|
|
|
637
577
|
const butThenProxy = new Proxy(pm, {
|
|
638
578
|
get(target, prop, receiver) {
|
|
639
579
|
if (prop === "customScreenShot") {
|
|
640
|
-
return (opts) =>
|
|
641
|
-
target.customScreenShot(
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
580
|
+
return (opts, p) =>
|
|
581
|
+
target.customScreenShot(
|
|
582
|
+
{
|
|
583
|
+
...opts,
|
|
584
|
+
path: `${filepath}/${opts.path}`,
|
|
585
|
+
},
|
|
586
|
+
p
|
|
587
|
+
);
|
|
645
588
|
}
|
|
646
589
|
|
|
647
590
|
if (prop === "writeFileSync") {
|
package/src/lib/types.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IBaseTest } from "../Types";
|
|
1
|
+
// import { IBaseTest } from "../Types";
|
|
2
2
|
|
|
3
3
|
import type { Plugin } from "esbuild";
|
|
4
4
|
import {
|
|
@@ -9,8 +9,7 @@ import {
|
|
|
9
9
|
BaseWhen,
|
|
10
10
|
BaseThen,
|
|
11
11
|
} from "./abstractBase";
|
|
12
|
-
import {
|
|
13
|
-
import { PM } from "../PM/index";
|
|
12
|
+
import { IBaseTest } from "../Types";
|
|
14
13
|
|
|
15
14
|
export type IFinalResults = { features: string[]; failed: number };
|
|
16
15
|
|
|
@@ -30,6 +29,7 @@ export type IPlugin = (
|
|
|
30
29
|
) => Plugin;
|
|
31
30
|
|
|
32
31
|
export type IBaseConfig = {
|
|
32
|
+
src: string;
|
|
33
33
|
clearScreen: boolean;
|
|
34
34
|
debugger: boolean;
|
|
35
35
|
devMode: boolean;
|
|
@@ -48,180 +48,6 @@ export type IBaseConfig = {
|
|
|
48
48
|
|
|
49
49
|
export type IBuiltConfig = { buildDir: string } & IBaseConfig;
|
|
50
50
|
|
|
51
|
-
export type IWebTestInterface<
|
|
52
|
-
ITestShape extends IBaseTest<
|
|
53
|
-
unknown,
|
|
54
|
-
unknown,
|
|
55
|
-
unknown,
|
|
56
|
-
unknown,
|
|
57
|
-
unknown,
|
|
58
|
-
unknown,
|
|
59
|
-
unknown,
|
|
60
|
-
Record<string, any>,
|
|
61
|
-
Record<string, any>,
|
|
62
|
-
Record<string, any>,
|
|
63
|
-
Record<string, any>,
|
|
64
|
-
Record<string, any>
|
|
65
|
-
>
|
|
66
|
-
> = {
|
|
67
|
-
assertThis: (x: ITestShape["then"]) => void;
|
|
68
|
-
|
|
69
|
-
andWhen: (
|
|
70
|
-
store: ITestShape["istore"],
|
|
71
|
-
whenCB: ITestShape["when"],
|
|
72
|
-
testResource: ITTestResourceConfiguration,
|
|
73
|
-
utils: PM
|
|
74
|
-
) => Promise<ITestShape["istore"]>;
|
|
75
|
-
butThen: (
|
|
76
|
-
store: ITestShape["istore"],
|
|
77
|
-
thenCB,
|
|
78
|
-
testResource: ITTestResourceConfiguration,
|
|
79
|
-
utils: PM
|
|
80
|
-
) => Promise<ITestShape["iselection"]>;
|
|
81
|
-
|
|
82
|
-
afterAll: (
|
|
83
|
-
store: ITestShape["istore"],
|
|
84
|
-
artificer: ITestArtificer,
|
|
85
|
-
utils: PM
|
|
86
|
-
) => any;
|
|
87
|
-
afterEach: (
|
|
88
|
-
store: ITestShape["istore"],
|
|
89
|
-
key: string,
|
|
90
|
-
artificer: ITestArtificer,
|
|
91
|
-
utils: PM
|
|
92
|
-
) => Promise<unknown>;
|
|
93
|
-
beforeAll: (
|
|
94
|
-
input: ITestShape["iinput"],
|
|
95
|
-
testResource: ITTestResourceConfiguration,
|
|
96
|
-
artificer: ITestArtificer,
|
|
97
|
-
utils: PM
|
|
98
|
-
) => Promise<ITestShape["isubject"]>;
|
|
99
|
-
beforeEach: (
|
|
100
|
-
subject: ITestShape["isubject"],
|
|
101
|
-
initializer: (c?) => ITestShape["given"],
|
|
102
|
-
artificer: ITestArtificer,
|
|
103
|
-
testResource: ITTestResourceConfiguration,
|
|
104
|
-
initialValues,
|
|
105
|
-
utils: PM
|
|
106
|
-
) => Promise<ITestShape["istore"]>;
|
|
107
|
-
};
|
|
108
|
-
// & ITestInterface<ITestShape>;
|
|
109
|
-
|
|
110
|
-
export type INodeTestInterface<
|
|
111
|
-
ITestShape extends IBaseTest<
|
|
112
|
-
unknown,
|
|
113
|
-
unknown,
|
|
114
|
-
unknown,
|
|
115
|
-
unknown,
|
|
116
|
-
unknown,
|
|
117
|
-
unknown,
|
|
118
|
-
unknown,
|
|
119
|
-
Record<string, any>,
|
|
120
|
-
Record<string, any>,
|
|
121
|
-
Record<string, any>,
|
|
122
|
-
Record<string, any>,
|
|
123
|
-
Record<string, any>
|
|
124
|
-
>
|
|
125
|
-
> = {
|
|
126
|
-
assertThis: (x: ITestShape["then"]) => void;
|
|
127
|
-
andWhen: (
|
|
128
|
-
store: ITestShape["istore"],
|
|
129
|
-
whenCB: ITestShape["when"],
|
|
130
|
-
testResource: ITTestResourceConfiguration,
|
|
131
|
-
utils: PM
|
|
132
|
-
) => Promise<ITestShape["istore"]>;
|
|
133
|
-
butThen: (
|
|
134
|
-
store: ITestShape["istore"],
|
|
135
|
-
thenCB,
|
|
136
|
-
testResource: ITTestResourceConfiguration,
|
|
137
|
-
utils: PM
|
|
138
|
-
) => Promise<ITestShape["iselection"]>;
|
|
139
|
-
afterAll: (
|
|
140
|
-
store: ITestShape["istore"],
|
|
141
|
-
artificer: ITestArtificer,
|
|
142
|
-
pm: PM
|
|
143
|
-
) => any;
|
|
144
|
-
afterEach: (
|
|
145
|
-
store: ITestShape["istore"],
|
|
146
|
-
key: string,
|
|
147
|
-
artificer: ITestArtificer,
|
|
148
|
-
pm: PM
|
|
149
|
-
) => Promise<unknown>;
|
|
150
|
-
beforeAll: (
|
|
151
|
-
input: ITestShape["iinput"],
|
|
152
|
-
testResource: ITTestResourceConfiguration,
|
|
153
|
-
artificer: ITestArtificer,
|
|
154
|
-
pm: PM
|
|
155
|
-
) => Promise<ITestShape["isubject"]>;
|
|
156
|
-
beforeEach: (
|
|
157
|
-
subject: ITestShape["isubject"],
|
|
158
|
-
initializer: (c?) => ITestShape["given"],
|
|
159
|
-
artificer: ITestArtificer,
|
|
160
|
-
testResource: ITTestResourceConfiguration,
|
|
161
|
-
initialValues,
|
|
162
|
-
pm: PM
|
|
163
|
-
) => Promise<ITestShape["istore"]>;
|
|
164
|
-
};
|
|
165
|
-
// & ITestInterface<ITestShape>;
|
|
166
|
-
|
|
167
|
-
export type ITestInterface<
|
|
168
|
-
ITestShape extends IBaseTest<
|
|
169
|
-
unknown,
|
|
170
|
-
unknown,
|
|
171
|
-
unknown,
|
|
172
|
-
unknown,
|
|
173
|
-
unknown,
|
|
174
|
-
unknown,
|
|
175
|
-
unknown,
|
|
176
|
-
Record<string, any>,
|
|
177
|
-
Record<string, any>,
|
|
178
|
-
Record<string, any>,
|
|
179
|
-
Record<string, any>,
|
|
180
|
-
Record<string, any>
|
|
181
|
-
>
|
|
182
|
-
> = {
|
|
183
|
-
assertThis: (x: ITestShape["then"]) => void;
|
|
184
|
-
|
|
185
|
-
andWhen: (
|
|
186
|
-
store: ITestShape["istore"],
|
|
187
|
-
whenCB: ITestShape["when"],
|
|
188
|
-
testResource: ITTestResourceConfiguration,
|
|
189
|
-
pm: PM
|
|
190
|
-
) => Promise<ITestShape["istore"]>;
|
|
191
|
-
butThen: (
|
|
192
|
-
store: ITestShape["istore"],
|
|
193
|
-
thenCB,
|
|
194
|
-
testResource: ITTestResourceConfiguration,
|
|
195
|
-
pm: PM
|
|
196
|
-
) => Promise<ITestShape["iselection"]>;
|
|
197
|
-
|
|
198
|
-
afterAll: (
|
|
199
|
-
store: ITestShape["istore"],
|
|
200
|
-
artificer: ITestArtificer,
|
|
201
|
-
pm: PM
|
|
202
|
-
) => any;
|
|
203
|
-
afterEach: (
|
|
204
|
-
store: ITestShape["istore"],
|
|
205
|
-
key: string,
|
|
206
|
-
artificer: ITestArtificer,
|
|
207
|
-
pm: PM
|
|
208
|
-
) => Promise<unknown>;
|
|
209
|
-
beforeAll: (
|
|
210
|
-
input: ITestShape["iinput"],
|
|
211
|
-
testResource: ITTestResourceConfiguration,
|
|
212
|
-
artificer: ITestArtificer,
|
|
213
|
-
pm: PM
|
|
214
|
-
) => Promise<ITestShape["isubject"]>;
|
|
215
|
-
beforeEach: (
|
|
216
|
-
subject: ITestShape["isubject"],
|
|
217
|
-
initializer: (c?) => ITestShape["given"],
|
|
218
|
-
artificer: ITestArtificer,
|
|
219
|
-
testResource: ITTestResourceConfiguration,
|
|
220
|
-
initialValues,
|
|
221
|
-
pm: PM
|
|
222
|
-
) => Promise<ITestShape["istore"]>;
|
|
223
|
-
};
|
|
224
|
-
|
|
225
51
|
export type ISuiteKlasser<
|
|
226
52
|
ITestShape extends IBaseTest<
|
|
227
53
|
unknown,
|