testeranto 0.75.0 → 0.79.3

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.
Files changed (136) hide show
  1. package/README.md +25 -24
  2. package/devBot.dockerfile +12 -0
  3. package/dist/common/Node.js +1 -0
  4. package/dist/common/PM/index.js +0 -64
  5. package/dist/common/PM/main.js +278 -7
  6. package/dist/common/PM/node.js +4 -0
  7. package/dist/common/PM/web.js +3 -0
  8. package/dist/common/Project.js +6 -2
  9. package/dist/common/Puppeteer.js +12 -17
  10. package/dist/common/Reporter.js +1 -8
  11. package/dist/common/SubPackages/react-dom/component/web.js +5 -25
  12. package/dist/common/SubPackages/react-dom/jsx/web.js +80 -55
  13. package/dist/common/SubPackages/react-test-renderer/component/index.js +0 -86
  14. package/dist/common/SubPackages/react-test-renderer/component/interface.js +68 -0
  15. package/dist/common/SubPackages/react-test-renderer/component/node.js +2 -2
  16. package/dist/common/SubPackages/react-test-renderer/component/web.js +2 -2
  17. package/dist/common/TaskManBackEnd.js +156 -0
  18. package/dist/common/Types.js +0 -2
  19. package/dist/common/esbuildConfigs/index.js +1 -0
  20. package/dist/common/esbuildConfigs/inputFilesPlugin.js +49 -0
  21. package/dist/common/esbuildConfigs/node.js +3 -1
  22. package/dist/common/esbuildConfigs/web.js +3 -1
  23. package/dist/common/lib/abstractBase.js +222 -17
  24. package/dist/common/lib/basebuilder.js +4 -38
  25. package/dist/common/lib/classBuilder.js +1 -3
  26. package/dist/common/lib/core.js +3 -5
  27. package/dist/common/mongooseSchemas.js +56 -0
  28. package/dist/common/tsconfig.common.tsbuildinfo +1 -1
  29. package/dist/common/utils.js +16 -0
  30. package/dist/module/ExampleTab.js +112 -0
  31. package/dist/module/Node.js +1 -0
  32. package/dist/module/PM/index.js +0 -64
  33. package/dist/module/PM/main.js +278 -7
  34. package/dist/module/PM/node.js +4 -0
  35. package/dist/module/PM/web.js +3 -0
  36. package/dist/module/Project.js +6 -2
  37. package/dist/module/Puppeteer.js +12 -17
  38. package/dist/module/Reporter.js +1 -8
  39. package/dist/module/SubPackages/react-dom/component/web.js +5 -25
  40. package/dist/module/SubPackages/react-dom/jsx/web.js +80 -55
  41. package/dist/module/SubPackages/react-test-renderer/component/index.js +1 -59
  42. package/dist/module/SubPackages/react-test-renderer/component/interface.js +39 -0
  43. package/dist/module/SubPackages/react-test-renderer/component/node.js +1 -1
  44. package/dist/module/SubPackages/react-test-renderer/component/web.js +1 -1
  45. package/dist/module/TaskManBackEnd.js +151 -0
  46. package/dist/module/TaskManFrontEnd.js +600 -0
  47. package/dist/module/Types.js +0 -2
  48. package/dist/module/esbuildConfigs/index.js +1 -0
  49. package/dist/module/esbuildConfigs/inputFilesPlugin.js +44 -0
  50. package/dist/module/esbuildConfigs/node.js +3 -1
  51. package/dist/module/esbuildConfigs/web.js +3 -1
  52. package/dist/module/lib/abstractBase.js +222 -17
  53. package/dist/module/lib/basebuilder.js +4 -38
  54. package/dist/module/lib/classBuilder.js +1 -3
  55. package/dist/module/lib/core.js +3 -5
  56. package/dist/module/mongooseSchemas.js +50 -0
  57. package/dist/module/tsconfig.module.tsbuildinfo +1 -1
  58. package/dist/module/utils.js +9 -0
  59. package/dist/prebuild/Report.js +117 -36
  60. package/dist/prebuild/TaskManBackEnd.mjs +185 -0
  61. package/dist/prebuild/TaskManFrontEnd.css +12301 -0
  62. package/dist/prebuild/TaskManFrontEnd.js +81737 -0
  63. package/dist/types/Node.d.ts +1 -1
  64. package/dist/types/PM/index.d.ts +2 -1
  65. package/dist/types/PM/main.d.ts +6 -3
  66. package/dist/types/PM/node.d.ts +2 -0
  67. package/dist/types/PM/web.d.ts +1 -0
  68. package/dist/types/SubPackages/puppeteer.d.ts +1 -1
  69. package/dist/types/SubPackages/react/component/node.d.ts +1 -1
  70. package/dist/types/SubPackages/react/component/web.d.ts +1 -1
  71. package/dist/types/SubPackages/react/jsx/node.d.ts +2 -2
  72. package/dist/types/SubPackages/react/jsx/web.d.ts +2 -2
  73. package/dist/types/SubPackages/react-dom/component/node.d.ts +2 -2
  74. package/dist/types/SubPackages/react-dom/component/web.d.ts +8 -2
  75. package/dist/types/SubPackages/react-dom/jsx/node.d.ts +2 -2
  76. package/dist/types/SubPackages/react-dom/jsx/web.d.ts +2 -2
  77. package/dist/types/SubPackages/react-test-renderer/MemoExoticComponent/node.d.ts +2 -2
  78. package/dist/types/SubPackages/react-test-renderer/component/index.d.ts +0 -7
  79. package/dist/types/SubPackages/react-test-renderer/component/interface.d.ts +9 -0
  80. package/dist/types/SubPackages/react-test-renderer/component/node.d.ts +1 -2
  81. package/dist/types/SubPackages/react-test-renderer/component/web.d.ts +1 -2
  82. package/dist/types/SubPackages/react-test-renderer/fc/node.d.ts +1 -1
  83. package/dist/types/SubPackages/react-test-renderer/fc/web.d.ts +1 -1
  84. package/dist/types/SubPackages/react-test-renderer/jsx/node.d.ts +1 -2
  85. package/dist/types/SubPackages/react-test-renderer/jsx/web.d.ts +1 -2
  86. package/dist/types/SubPackages/react-test-renderer/jsx-promised/node.d.ts +1 -2
  87. package/dist/types/SubPackages/react-test-renderer/jsx-promised/web.d.ts +1 -2
  88. package/dist/types/TaskManBackEnd.d.ts +1 -0
  89. package/dist/types/Types.d.ts +19 -19
  90. package/dist/types/Web.d.ts +1 -1
  91. package/dist/types/esbuildConfigs/inputFilesPlugin.d.ts +5 -0
  92. package/dist/types/lib/abstractBase.d.ts +8 -8
  93. package/dist/types/lib/basebuilder.d.ts +1 -1
  94. package/dist/types/lib/classBuilder.d.ts +1 -1
  95. package/dist/types/lib/core.d.ts +1 -1
  96. package/dist/types/lib/index.d.ts +5 -5
  97. package/dist/types/lib/types.d.ts +15 -13
  98. package/dist/types/mongooseSchemas.d.ts +124 -0
  99. package/dist/types/tsconfig.types.tsbuildinfo +1 -1
  100. package/dist/types/utils.d.ts +2 -0
  101. package/docker-compose-dev.yml +9 -0
  102. package/docker-compose-prod.yml +18 -0
  103. package/package.json +20 -7
  104. package/src/ExampleTab.tsx +219 -0
  105. package/src/Node.ts +31 -2
  106. package/src/PM/index.ts +6 -83
  107. package/src/PM/main.ts +389 -11
  108. package/src/PM/node.ts +6 -0
  109. package/src/PM/web.ts +4 -0
  110. package/src/Project.ts +10 -2
  111. package/src/Puppeteer.ts +16 -17
  112. package/src/Report.tsx +17 -40
  113. package/src/Reporter.ts +1 -9
  114. package/src/SubPackages/react-dom/component/web.ts +10 -30
  115. package/src/SubPackages/react-dom/jsx/web.ts +111 -74
  116. package/src/SubPackages/react-test-renderer/component/index.ts +0 -66
  117. package/src/SubPackages/react-test-renderer/component/interface.ts +48 -0
  118. package/src/SubPackages/react-test-renderer/component/node.ts +2 -1
  119. package/src/SubPackages/react-test-renderer/component/web.ts +2 -1
  120. package/src/TaskManBackEnd.ts +200 -0
  121. package/src/TaskManFrontEnd.tsx +1222 -0
  122. package/src/Types.ts +136 -28
  123. package/src/Web.ts +32 -2
  124. package/src/esbuildConfigs/index.ts +1 -0
  125. package/src/esbuildConfigs/inputFilesPlugin.ts +65 -0
  126. package/src/esbuildConfigs/node.ts +3 -1
  127. package/src/esbuildConfigs/web.ts +4 -0
  128. package/src/lib/abstractBase.ts +337 -34
  129. package/src/lib/basebuilder.ts +17 -52
  130. package/src/lib/classBuilder.ts +14 -2
  131. package/src/lib/core.ts +18 -7
  132. package/src/lib/index.ts +115 -7
  133. package/src/lib/types.ts +143 -35
  134. package/src/mongooseSchemas.ts +105 -0
  135. package/src/utils.ts +15 -0
  136. package/yarn-error.log +3144 -0
package/src/Types.ts CHANGED
@@ -14,16 +14,72 @@ import {
14
14
  IWebTestInterface,
15
15
  } from "./lib/types.js";
16
16
 
17
- export type IPartialInterface<I extends IBaseTest> = Partial<ITestInterface<I>>;
17
+ export type IPartialInterface<
18
+ I extends IBaseTest<
19
+ unknown,
20
+ unknown,
21
+ unknown,
22
+ unknown,
23
+ unknown,
24
+ unknown,
25
+ unknown,
26
+ Record<string, any>,
27
+ Record<string, any>,
28
+ Record<string, any>,
29
+ Record<string, any>,
30
+ Record<string, any>
31
+ >
32
+ > = Partial<ITestInterface<I>>;
18
33
 
19
- export type IPartialNodeInterface<I extends IBaseTest> = Partial<
20
- INodeTestInterface<I>
21
- >;
22
- export type IPartialWebInterface<I extends IBaseTest> = Partial<
23
- IWebTestInterface<I>
24
- >;
34
+ export type IPartialNodeInterface<
35
+ I extends IBaseTest<
36
+ unknown,
37
+ unknown,
38
+ unknown,
39
+ unknown,
40
+ unknown,
41
+ unknown,
42
+ unknown,
43
+ Record<string, any>,
44
+ Record<string, any>,
45
+ Record<string, any>,
46
+ Record<string, any>,
47
+ Record<string, any>
48
+ >
49
+ > = Partial<INodeTestInterface<I>>;
50
+ export type IPartialWebInterface<
51
+ I extends IBaseTest<
52
+ unknown,
53
+ unknown,
54
+ unknown,
55
+ unknown,
56
+ unknown,
57
+ unknown,
58
+ unknown,
59
+ Record<string, any>,
60
+ Record<string, any>,
61
+ Record<string, any>,
62
+ Record<string, any>,
63
+ Record<string, any>
64
+ >
65
+ > = Partial<IWebTestInterface<I>>;
25
66
 
26
- export type IEntry<ITestShape extends IBaseTest> = (
67
+ export type IEntry<
68
+ ITestShape extends IBaseTest<
69
+ unknown,
70
+ unknown,
71
+ unknown,
72
+ unknown,
73
+ unknown,
74
+ unknown,
75
+ unknown,
76
+ Record<string, any>,
77
+ Record<string, any>,
78
+ Record<string, any>,
79
+ Record<string, any>,
80
+ Record<string, any>
81
+ >
82
+ > = (
27
83
  input: ITestShape["iinput"],
28
84
  testSpecification: ITestSpecification<ITestShape>,
29
85
  testImplementation: ITestImplementation<ITestShape, object>,
@@ -31,7 +87,22 @@ export type IEntry<ITestShape extends IBaseTest> = (
31
87
  testResourceRequirement: ITTestResourceRequest
32
88
  ) => Promise<Testeranto<ITestShape>>;
33
89
 
34
- export type ITestSpecification<ITestShape extends IBaseTest> = (
90
+ export type ITestSpecification<
91
+ ITestShape extends IBaseTest<
92
+ unknown,
93
+ unknown,
94
+ unknown,
95
+ unknown,
96
+ unknown,
97
+ unknown,
98
+ unknown,
99
+ Record<string, any>,
100
+ Record<string, any>,
101
+ Record<string, any>,
102
+ Record<string, any>,
103
+ Record<string, any>
104
+ >
105
+ > = (
35
106
  Suite: {
36
107
  [K in keyof ITestShape["suites"]]: (
37
108
  name: string,
@@ -61,7 +132,20 @@ export type ITestSpecification<ITestShape extends IBaseTest> = (
61
132
  ) => any[];
62
133
 
63
134
  export type ITestImplementation<
64
- ITestShape extends IBaseTest,
135
+ ITestShape extends IBaseTest<
136
+ unknown,
137
+ unknown,
138
+ unknown,
139
+ unknown,
140
+ unknown,
141
+ unknown,
142
+ unknown,
143
+ Record<string, any>,
144
+ Record<string, any>,
145
+ Record<string, any>,
146
+ Record<string, any>,
147
+ Record<string, any>
148
+ >,
65
149
  IMod = object
66
150
  > = Modify<
67
151
  {
@@ -94,24 +178,48 @@ export type ITestImplementation<
94
178
 
95
179
  type Modify<T, R> = Omit<T, keyof R> & R;
96
180
 
97
- export type IBaseTest<Shape = any, II = Shape> = {
98
- iinput: II;
99
- isubject: Shape;
100
- istore: Shape;
101
- iselection: Shape;
102
- // iinitial;
181
+ // export type IBaseTest<Shape = any, II = Shape> = {
182
+ // iinput: II;
183
+ // isubject: Shape;
184
+ // istore: Shape;
185
+ // iselection: Shape;
186
+ // // iinitial;
103
187
 
104
- given;
105
- when;
106
- then;
107
-
108
- suites: Record<string, any>;
109
- givens: Record<string, any>;
110
- whens: Record<string, any>;
111
- thens: Record<string, any>;
112
- checks: Record<string, any>;
113
- };
114
-
115
- // export type ITTestShape = {
188
+ // given;
189
+ // when;
190
+ // then;
116
191
 
192
+ // suites: Record<string, any>;
193
+ // givens: Record<string, any>;
194
+ // whens: Record<string, any>;
195
+ // thens: Record<string, any>;
196
+ // checks: Record<string, any>;
117
197
  // };
198
+
199
+ export type IBaseTest<
200
+ IInput,
201
+ ISubject,
202
+ IStore,
203
+ ISelection,
204
+ IGiven,
205
+ IWhen,
206
+ IThen,
207
+ ISuites extends Record<string, any>,
208
+ IGivens extends Record<string, any>,
209
+ IWhens extends Record<string, any>,
210
+ IThens extends Record<string, any>,
211
+ IChecks extends Record<string, any>
212
+ > = {
213
+ iinput: IInput;
214
+ isubject: ISubject;
215
+ istore: IStore;
216
+ iselection: ISelection;
217
+ given: IGiven;
218
+ when: IWhen;
219
+ then: IThen;
220
+ suites: ISuites;
221
+ givens: IGivens;
222
+ whens: IWhens;
223
+ thens: IThens;
224
+ checks: IChecks;
225
+ };
package/src/Web.ts CHANGED
@@ -12,7 +12,22 @@ import {
12
12
  } from "./lib/index.js";
13
13
  import { ITestInterface, IWebTestInterface } from "./lib/types";
14
14
 
15
- class WebTesteranto<TestShape extends IBaseTest> extends Testeranto<TestShape> {
15
+ class WebTesteranto<
16
+ TestShape extends IBaseTest<
17
+ unknown,
18
+ unknown,
19
+ unknown,
20
+ unknown,
21
+ unknown,
22
+ unknown,
23
+ unknown,
24
+ Record<string, any>,
25
+ Record<string, any>,
26
+ Record<string, any>,
27
+ Record<string, any>,
28
+ Record<string, any>
29
+ >
30
+ > extends Testeranto<TestShape> {
16
31
  constructor(
17
32
  input: TestShape["iinput"],
18
33
  testSpecification: ITestSpecification<TestShape>,
@@ -55,7 +70,22 @@ class WebTesteranto<TestShape extends IBaseTest> extends Testeranto<TestShape> {
55
70
  }
56
71
  }
57
72
 
58
- export default async <ITestShape extends IBaseTest>(
73
+ export default async <
74
+ ITestShape extends IBaseTest<
75
+ unknown,
76
+ unknown,
77
+ unknown,
78
+ unknown,
79
+ unknown,
80
+ unknown,
81
+ unknown,
82
+ Record<string, any>,
83
+ Record<string, any>,
84
+ Record<string, any>,
85
+ Record<string, any>,
86
+ Record<string, any>
87
+ >
88
+ >(
59
89
  input: ITestShape["iinput"],
60
90
  testSpecification: ITestSpecification<ITestShape>,
61
91
  testImplementation: ITestImplementation<ITestShape>,
@@ -4,6 +4,7 @@ import { IBaseConfig } from "../lib/types";
4
4
 
5
5
  export default (config: IBaseConfig): BuildOptions => {
6
6
  return {
7
+ // packages: "external",
7
8
  target: "esnext",
8
9
  format: "esm",
9
10
  splitting: true,
@@ -0,0 +1,65 @@
1
+ import fs from "fs";
2
+ import path from "path";
3
+
4
+ export default (
5
+ platform: "web" | "node",
6
+ entryPoints: Set<string> | string[]
7
+ ) => {
8
+ return {
9
+ name: "metafileWriter",
10
+ setup(build) {
11
+ build.onEnd((result) => {
12
+ if (result.errors.length === 0) {
13
+ entryPoints.forEach((entryPoint) => {
14
+ const filePath = path.join(
15
+ "./docs/",
16
+ platform,
17
+ entryPoint.split(".").slice(0, -1).join("."),
18
+ `inputFiles.json`
19
+ );
20
+
21
+ const dirName = path.dirname(filePath);
22
+
23
+ if (!fs.existsSync(dirName)) {
24
+ fs.mkdirSync(dirName, { recursive: true });
25
+ }
26
+
27
+ fs.writeFileSync(
28
+ filePath,
29
+ JSON.stringify(
30
+ Object.keys(
31
+ Object.keys(result.metafile.outputs)
32
+ .filter((s: string) => {
33
+ if (!result.metafile.outputs[s].entryPoint) {
34
+ return false;
35
+ }
36
+ return (
37
+ path.resolve(result.metafile.outputs[s].entryPoint) ===
38
+ path.resolve(entryPoint)
39
+ );
40
+ })
41
+ .reduce((mm: string[], el) => {
42
+ mm.push(result.metafile.outputs[el].inputs);
43
+ return mm;
44
+ }, [])[0]
45
+ )
46
+ .filter((f: string) => {
47
+ const regex = /^src\/.*/g;
48
+ const matches = f.match(regex);
49
+ const passes = matches?.length === 1;
50
+ return passes;
51
+ })
52
+ .filter((f: string) => {
53
+ const regex = /.*\.test\..*/g;
54
+ const matches = f.match(regex);
55
+ const passes = matches?.length === 1;
56
+ return !passes;
57
+ })
58
+ )
59
+ );
60
+ });
61
+ }
62
+ });
63
+ },
64
+ };
65
+ };
@@ -3,6 +3,7 @@ import { BuildOptions } from "esbuild";
3
3
  import { IBaseConfig } from "../lib/types";
4
4
 
5
5
  import baseEsBuildConfig from "./index.js";
6
+ import inputFilesPlugin from "./inputFilesPlugin";
6
7
 
7
8
  export default (
8
9
  config: IBaseConfig,
@@ -16,7 +17,7 @@ export default (
16
17
  outdir: config.outdir + "/node",
17
18
 
18
19
  inject: [`./node_modules/testeranto/dist/cjs-shim.js`],
19
-
20
+ metafile: true,
20
21
  supported: {
21
22
  "dynamic-import": true,
22
23
  },
@@ -42,6 +43,7 @@ export default (
42
43
  entryPoints: [...entryPoints],
43
44
  plugins: [
44
45
  ...(config.nodePlugins || []),
46
+ inputFilesPlugin("node", entryPoints),
45
47
  {
46
48
  name: "rebuild-notify",
47
49
  setup(build) {
@@ -4,6 +4,7 @@ import path from "path";
4
4
  import { IBaseConfig } from "../lib/types.js";
5
5
 
6
6
  import baseEsBuildConfig from "./index.js";
7
+ import inputFilesPlugin from "./inputFilesPlugin.js";
7
8
 
8
9
  export default (
9
10
  config: IBaseConfig,
@@ -25,6 +26,8 @@ export default (
25
26
  react: path.resolve("./node_modules/react"),
26
27
  },
27
28
 
29
+ metafile: true,
30
+
28
31
  external: [
29
32
  "testeranto.json",
30
33
  "features.test.ts",
@@ -57,6 +60,7 @@ export default (
57
60
 
58
61
  plugins: [
59
62
  ...(config.webPlugins || []),
63
+ inputFilesPlugin("node", entryPoints),
60
64
  {
61
65
  name: "rebuild-notify",
62
66
  setup(build) {