testeranto 0.100.0 → 0.111.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (226) hide show
  1. package/README.md +1 -0
  2. package/bundle.js +80 -30
  3. package/package.json +40 -32
  4. package/src/Footer.tsx +4 -0
  5. package/src/Init.ts +48 -0
  6. package/src/Node.ts +23 -17
  7. package/src/PM/index.ts +1 -1
  8. package/src/PM/main.ts +524 -156
  9. package/src/PM/node.ts +2 -2
  10. package/src/PM/web.ts +1 -1
  11. package/src/ReportClient.tsx +163 -0
  12. package/src/ReportServer.ts +21 -0
  13. package/src/SubPackages/react/component/node.ts +68 -24
  14. package/src/SubPackages/react/component/web.ts +68 -25
  15. package/src/SubPackages/react/jsx/index.ts +39 -18
  16. package/src/SubPackages/react/jsx/node.ts +12 -10
  17. package/src/SubPackages/react/jsx/web.ts +27 -14
  18. package/src/SubPackages/react-dom/component/node.ts +42 -50
  19. package/src/SubPackages/react-dom/component/web.ts +28 -10
  20. package/src/SubPackages/react-dom/jsx/node.ts +54 -56
  21. package/src/SubPackages/react-dom/jsx/web.ts +55 -42
  22. package/src/SubPackages/react-test-renderer/MemoExoticComponent/node.ts +23 -7
  23. package/src/SubPackages/react-test-renderer/component/index.ts +38 -5
  24. package/src/SubPackages/react-test-renderer/component/node.ts +24 -5
  25. package/src/SubPackages/react-test-renderer/component/web.ts +22 -5
  26. package/src/SubPackages/react-test-renderer/fc/node.ts +41 -7
  27. package/src/SubPackages/react-test-renderer/fc/web.ts +43 -11
  28. package/src/SubPackages/react-test-renderer/jsx/index.ts +39 -16
  29. package/src/SubPackages/react-test-renderer/jsx/node.ts +8 -6
  30. package/src/SubPackages/react-test-renderer/jsx/web.ts +22 -5
  31. package/src/SubPackages/react-test-renderer/jsx-promised/index.ts +39 -6
  32. package/src/SubPackages/react-test-renderer/jsx-promised/node.ts +27 -10
  33. package/src/SubPackages/react-test-renderer/jsx-promised/web.ts +26 -12
  34. package/src/TestReport.tsx +176 -0
  35. package/src/Types.ts +63 -309
  36. package/src/Web.ts +24 -18
  37. package/src/build.ts +240 -0
  38. package/src/defaultConfig.ts +2 -1
  39. package/src/esbuildConfigs/eslint-formatter-testeranto.ts +5 -0
  40. package/src/esbuildConfigs/featuresPlugin.ts +0 -1
  41. package/src/esbuildConfigs/index.ts +1 -1
  42. package/src/esbuildConfigs/inputFilesPlugin.ts +2 -135
  43. package/src/esbuildConfigs/node.ts +4 -13
  44. package/src/esbuildConfigs/web.ts +3 -19
  45. package/src/init-docs.ts +2 -1
  46. package/src/lib/abstractBase.ts +82 -80
  47. package/src/lib/basebuilder.ts +57 -45
  48. package/src/lib/classBuilder.ts +15 -15
  49. package/src/lib/core.ts +44 -35
  50. package/src/lib/index.ts +47 -98
  51. package/src/lib/readme.md +12 -0
  52. package/src/lib/types.ts +53 -70
  53. package/src/run.ts +31 -0
  54. package/src/style.css +8 -0
  55. package/src/utils.ts +74 -2
  56. package/tsc.log +108 -0
  57. package/Bundle.Dockerfile +0 -52
  58. package/bin/init-docs.js +0 -24
  59. package/dist/common/dist/module/src/Init.js +0 -40
  60. package/dist/common/package.json +0 -3
  61. package/dist/common/src/Init.js +0 -40
  62. package/dist/common/src/Node.js +0 -27
  63. package/dist/common/src/PM/index.js +0 -7
  64. package/dist/common/src/PM/main.js +0 -941
  65. package/dist/common/src/PM/node.js +0 -128
  66. package/dist/common/src/PM/web.js +0 -121
  67. package/dist/common/src/SubPackages/puppeteer.js +0 -21
  68. package/dist/common/src/SubPackages/react/component/node.js +0 -19
  69. package/dist/common/src/SubPackages/react/component/web.js +0 -19
  70. package/dist/common/src/SubPackages/react/jsx/index.js +0 -33
  71. package/dist/common/src/SubPackages/react/jsx/node.js +0 -10
  72. package/dist/common/src/SubPackages/react/jsx/web.js +0 -10
  73. package/dist/common/src/SubPackages/react-dom/component/node.js +0 -101
  74. package/dist/common/src/SubPackages/react-dom/component/web.js +0 -67
  75. package/dist/common/src/SubPackages/react-dom/jsx/index.js +0 -2
  76. package/dist/common/src/SubPackages/react-dom/jsx/node.js +0 -39
  77. package/dist/common/src/SubPackages/react-dom/jsx/web.js +0 -117
  78. package/dist/common/src/SubPackages/react-test-renderer/MemoExoticComponent/node.js +0 -44
  79. package/dist/common/src/SubPackages/react-test-renderer/component/index.js +0 -2
  80. package/dist/common/src/SubPackages/react-test-renderer/component/interface.js +0 -60
  81. package/dist/common/src/SubPackages/react-test-renderer/component/node.js +0 -8
  82. package/dist/common/src/SubPackages/react-test-renderer/component/web.js +0 -8
  83. package/dist/common/src/SubPackages/react-test-renderer/fc/node.js +0 -50
  84. package/dist/common/src/SubPackages/react-test-renderer/fc/web.js +0 -50
  85. package/dist/common/src/SubPackages/react-test-renderer/jsx/index.js +0 -63
  86. package/dist/common/src/SubPackages/react-test-renderer/jsx/node.js +0 -10
  87. package/dist/common/src/SubPackages/react-test-renderer/jsx/web.js +0 -10
  88. package/dist/common/src/SubPackages/react-test-renderer/jsx-promised/index.js +0 -42
  89. package/dist/common/src/SubPackages/react-test-renderer/jsx-promised/node.js +0 -10
  90. package/dist/common/src/SubPackages/react-test-renderer/jsx-promised/web.js +0 -10
  91. package/dist/common/src/Types.js +0 -2
  92. package/dist/common/src/Web.js +0 -49
  93. package/dist/common/src/cli.js +0 -439
  94. package/dist/common/src/cli2.js +0 -144
  95. package/dist/common/src/defaultConfig.js +0 -19
  96. package/dist/common/src/esbuildConfigs/featuresPlugin.js +0 -39
  97. package/dist/common/src/esbuildConfigs/index.js +0 -21
  98. package/dist/common/src/esbuildConfigs/inputFilesPlugin.js +0 -99
  99. package/dist/common/src/esbuildConfigs/node.js +0 -45
  100. package/dist/common/src/esbuildConfigs/web.js +0 -61
  101. package/dist/common/src/init-docs.js +0 -43
  102. package/dist/common/src/lib/abstractBase.js +0 -324
  103. package/dist/common/src/lib/basebuilder.js +0 -85
  104. package/dist/common/src/lib/classBuilder.js +0 -42
  105. package/dist/common/src/lib/core.js +0 -101
  106. package/dist/common/src/lib/index.js +0 -22
  107. package/dist/common/src/lib/types.js +0 -3
  108. package/dist/common/src/puppeteerConfiger.js +0 -24
  109. package/dist/common/src/utils.js +0 -16
  110. package/dist/common/src/web.html.js +0 -22
  111. package/dist/common/testeranto.js +0 -15
  112. package/dist/common/tsconfig.common.tsbuildinfo +0 -1
  113. package/dist/module/package.json +0 -3
  114. package/dist/module/src/Init.js +0 -35
  115. package/dist/module/src/Node.js +0 -20
  116. package/dist/module/src/PM/index.js +0 -3
  117. package/dist/module/src/PM/main.js +0 -911
  118. package/dist/module/src/PM/node.js +0 -121
  119. package/dist/module/src/PM/web.js +0 -117
  120. package/dist/module/src/SubPackages/puppeteer.js +0 -16
  121. package/dist/module/src/SubPackages/react/component/node.js +0 -14
  122. package/dist/module/src/SubPackages/react/component/web.js +0 -14
  123. package/dist/module/src/SubPackages/react/jsx/index.js +0 -27
  124. package/dist/module/src/SubPackages/react/jsx/node.js +0 -5
  125. package/dist/module/src/SubPackages/react/jsx/web.js +0 -5
  126. package/dist/module/src/SubPackages/react-dom/component/node.js +0 -93
  127. package/dist/module/src/SubPackages/react-dom/component/web.js +0 -62
  128. package/dist/module/src/SubPackages/react-dom/jsx/index.js +0 -1
  129. package/dist/module/src/SubPackages/react-dom/jsx/node.js +0 -31
  130. package/dist/module/src/SubPackages/react-dom/jsx/web.js +0 -89
  131. package/dist/module/src/SubPackages/react-test-renderer/MemoExoticComponent/node.js +0 -16
  132. package/dist/module/src/SubPackages/react-test-renderer/component/index.js +0 -1
  133. package/dist/module/src/SubPackages/react-test-renderer/component/interface.js +0 -31
  134. package/dist/module/src/SubPackages/react-test-renderer/component/node.js +0 -3
  135. package/dist/module/src/SubPackages/react-test-renderer/component/web.js +0 -3
  136. package/dist/module/src/SubPackages/react-test-renderer/fc/node.js +0 -22
  137. package/dist/module/src/SubPackages/react-test-renderer/fc/web.js +0 -22
  138. package/dist/module/src/SubPackages/react-test-renderer/jsx/index.js +0 -34
  139. package/dist/module/src/SubPackages/react-test-renderer/jsx/node.js +0 -5
  140. package/dist/module/src/SubPackages/react-test-renderer/jsx/web.js +0 -5
  141. package/dist/module/src/SubPackages/react-test-renderer/jsx-promised/index.js +0 -16
  142. package/dist/module/src/SubPackages/react-test-renderer/jsx-promised/node.js +0 -5
  143. package/dist/module/src/SubPackages/react-test-renderer/jsx-promised/web.js +0 -5
  144. package/dist/module/src/Types.js +0 -1
  145. package/dist/module/src/Web.js +0 -42
  146. package/dist/module/src/cli.js +0 -411
  147. package/dist/module/src/cli2.js +0 -116
  148. package/dist/module/src/defaultConfig.js +0 -17
  149. package/dist/module/src/esbuildConfigs/featuresPlugin.js +0 -34
  150. package/dist/module/src/esbuildConfigs/index.js +0 -19
  151. package/dist/module/src/esbuildConfigs/inputFilesPlugin.js +0 -94
  152. package/dist/module/src/esbuildConfigs/node.js +0 -40
  153. package/dist/module/src/esbuildConfigs/web.js +0 -56
  154. package/dist/module/src/init-docs.js +0 -15
  155. package/dist/module/src/lib/abstractBase.js +0 -316
  156. package/dist/module/src/lib/basebuilder.js +0 -81
  157. package/dist/module/src/lib/classBuilder.js +0 -38
  158. package/dist/module/src/lib/core.js +0 -98
  159. package/dist/module/src/lib/index.js +0 -18
  160. package/dist/module/src/lib/types.js +0 -2
  161. package/dist/module/src/puppeteerConfiger.js +0 -19
  162. package/dist/module/src/utils.js +0 -9
  163. package/dist/module/src/web.html.js +0 -20
  164. package/dist/module/testeranto.js +0 -13
  165. package/dist/module/tsconfig.module.tsbuildinfo +0 -1
  166. package/dist/prebuild/cli.mjs +0 -1491
  167. package/dist/prebuild/cli2.mjs +0 -918
  168. package/dist/prebuild/init-docs.mjs +0 -48
  169. package/dist/types/dist/module/src/Init.d.ts +0 -2
  170. package/dist/types/src/Init.d.ts +0 -2
  171. package/dist/types/src/Node.d.ts +0 -13
  172. package/dist/types/src/PM/index.d.ts +0 -34
  173. package/dist/types/src/PM/main.d.ts +0 -56
  174. package/dist/types/src/PM/node.d.ts +0 -42
  175. package/dist/types/src/PM/web.d.ts +0 -40
  176. package/dist/types/src/SubPackages/puppeteer.d.ts +0 -6
  177. package/dist/types/src/SubPackages/react/component/node.d.ts +0 -7
  178. package/dist/types/src/SubPackages/react/component/web.d.ts +0 -7
  179. package/dist/types/src/SubPackages/react/jsx/index.d.ts +0 -12
  180. package/dist/types/src/SubPackages/react/jsx/node.d.ts +0 -4
  181. package/dist/types/src/SubPackages/react/jsx/web.d.ts +0 -4
  182. package/dist/types/src/SubPackages/react-dom/component/node.d.ts +0 -12
  183. package/dist/types/src/SubPackages/react-dom/component/web.d.ts +0 -11
  184. package/dist/types/src/SubPackages/react-dom/jsx/index.d.ts +0 -7
  185. package/dist/types/src/SubPackages/react-dom/jsx/node.d.ts +0 -6
  186. package/dist/types/src/SubPackages/react-dom/jsx/web.d.ts +0 -5
  187. package/dist/types/src/SubPackages/react-test-renderer/MemoExoticComponent/node.d.ts +0 -5
  188. package/dist/types/src/SubPackages/react-test-renderer/component/index.d.ts +0 -13
  189. package/dist/types/src/SubPackages/react-test-renderer/component/interface.d.ts +0 -9
  190. package/dist/types/src/SubPackages/react-test-renderer/component/node.d.ts +0 -8
  191. package/dist/types/src/SubPackages/react-test-renderer/component/web.d.ts +0 -3
  192. package/dist/types/src/SubPackages/react-test-renderer/fc/node.d.ts +0 -8
  193. package/dist/types/src/SubPackages/react-test-renderer/fc/web.d.ts +0 -8
  194. package/dist/types/src/SubPackages/react-test-renderer/jsx/index.d.ts +0 -17
  195. package/dist/types/src/SubPackages/react-test-renderer/jsx/node.d.ts +0 -9
  196. package/dist/types/src/SubPackages/react-test-renderer/jsx/web.d.ts +0 -8
  197. package/dist/types/src/SubPackages/react-test-renderer/jsx-promised/index.d.ts +0 -16
  198. package/dist/types/src/SubPackages/react-test-renderer/jsx-promised/node.d.ts +0 -4
  199. package/dist/types/src/SubPackages/react-test-renderer/jsx-promised/web.d.ts +0 -4
  200. package/dist/types/src/Types.d.ts +0 -90
  201. package/dist/types/src/Web.d.ts +0 -10
  202. package/dist/types/src/cli.d.ts +0 -1
  203. package/dist/types/src/cli2.d.ts +0 -1
  204. package/dist/types/src/defaultConfig.d.ts +0 -3
  205. package/dist/types/src/esbuildConfigs/featuresPlugin.d.ts +0 -5
  206. package/dist/types/src/esbuildConfigs/index.d.ts +0 -4
  207. package/dist/types/src/esbuildConfigs/inputFilesPlugin.d.ts +0 -7
  208. package/dist/types/src/esbuildConfigs/node.d.ts +0 -4
  209. package/dist/types/src/esbuildConfigs/web.d.ts +0 -4
  210. package/dist/types/src/init-docs.d.ts +0 -1
  211. package/dist/types/src/lib/abstractBase.d.ts +0 -110
  212. package/dist/types/src/lib/basebuilder.d.ts +0 -27
  213. package/dist/types/src/lib/classBuilder.d.ts +0 -7
  214. package/dist/types/src/lib/core.d.ts +0 -8
  215. package/dist/types/src/lib/index.d.ts +0 -60
  216. package/dist/types/src/lib/types.d.ts +0 -40
  217. package/dist/types/src/puppeteerConfiger.d.ts +0 -4
  218. package/dist/types/src/utils.d.ts +0 -2
  219. package/dist/types/src/web.html.d.ts +0 -2
  220. package/dist/types/testeranto.d.ts +0 -16
  221. package/dist/types/tsconfig.types.tsbuildinfo +0 -1
  222. package/docker-compose.yml +0 -37
  223. package/src/SubPackages/puppeteer.ts +0 -51
  224. package/src/cli.ts +0 -535
  225. package/src/cli2.ts +0 -157
  226. package/testeranto.ts +0 -13
@@ -8,69 +8,61 @@ import Stream from "stream";
8
8
  import Testeranto from "../../../Node.js";
9
9
 
10
10
  import {
11
- IBaseTest,
11
+ Ibdd_in,
12
+ Ibdd_out,
12
13
  ITestImplementation,
13
14
  ITestSpecification,
14
15
  } from "../../../Types";
15
16
 
16
17
  type IInput = typeof React.Component;
17
- type InitialState = unknown;
18
- type IWhenShape = any;
19
- export type IThenShape = any;
18
+
20
19
  export type ISelection = ReactNode;
21
20
  export type IStore = ReactNode;
22
21
  export type ISubject = ReactNode;
23
22
 
24
23
  export { renderToStaticMarkup, renderToStaticNodeStream, Stream };
25
24
 
26
- export default <ITestShape extends IBaseTest>(
27
- testImplementations: ITestImplementation<ITestShape>,
28
- testSpecifications: ITestSpecification<ITestShape>,
25
+ export default <
26
+ I extends Ibdd_in<
27
+ IInput,
28
+ ISubject,
29
+ IStore,
30
+ ISelection,
31
+ unknown,
32
+ (s: IStore) => IStore,
33
+ unknown
34
+ >,
35
+ O extends Ibdd_out<
36
+ Record<string, any>,
37
+ Record<string, any>,
38
+ Record<string, any>,
39
+ Record<string, any>,
40
+ Record<string, any>
41
+ >
42
+ >(
43
+ testImplementations: ITestImplementation<I, O>,
44
+ testSpecifications: ITestSpecification<I, O>,
29
45
  testInput: IInput
30
46
  ) => {
31
- return Testeranto<ITestShape>(
32
- testInput,
33
- testSpecifications,
34
- testImplementations,
35
- {
36
- // beforeAll: async (
37
- // prototype,
38
- // artificer
39
- // ): Promise<ISubject> => {
40
- // return await new Promise((resolve, rej) => {
41
- // const elem = document.getElementById("root");
42
- // if (elem) {
43
- // resolve({ htmlElement: elem });
44
- // }
45
-
46
- // })
47
- // },
48
- beforeEach: async (
49
- reactComponent,
50
- ndx,
51
- testRsource,
52
- artificer
53
- ): Promise<IStore> => {
54
- return new Promise((resolve, rej) => {
55
- // Ignore these type errors
56
- resolve(createElement(testInput));
57
- });
58
- },
59
- andWhen: async function (s: IStore, whenCB): Promise<ISelection> {
60
- return whenCB(s);
61
- // return s
62
- },
63
- butThen: async function (s: IStore): Promise<ISelection> {
64
- return s;
65
- },
66
- afterEach: async function (store: IStore, ndx, artificer) {
67
- return {};
68
- },
69
- afterAll: (store: IStore, artificer) => {
70
- return;
71
- },
72
- }
73
- );
47
+ return Testeranto<I, O>(testInput, testSpecifications, testImplementations, {
48
+ beforeEach: async (): Promise<IStore> => {
49
+ return new Promise((resolve, rej) => {
50
+ resolve(createElement(testInput));
51
+ });
52
+ },
53
+ andWhen: async function (s, whenCB) {
54
+ return whenCB(s);
55
+ },
56
+ butThen: async function (s) {
57
+ return s;
58
+ },
59
+ afterEach: async function () {
60
+ return {};
61
+ },
62
+ afterAll: () => {
63
+ return;
64
+ },
65
+ });
74
66
  };
75
67
 
76
68
  // type IInput = typeof React.Component;
@@ -3,7 +3,8 @@ import ReactDom from "react-dom/client";
3
3
 
4
4
  import Testeranto from "../../../Web.js";
5
5
  import {
6
- IBaseTest,
6
+ Ibdd_in,
7
+ Ibdd_out,
7
8
  IPartialInterface,
8
9
  IPartialWebInterface,
9
10
  ITestImplementation,
@@ -11,10 +12,10 @@ import {
11
12
  } from "../../../Types";
12
13
 
13
14
  type IInput = typeof React.Component;
14
- type InitialState = unknown;
15
15
  type ISelection = {
16
16
  htmlElement: HTMLElement;
17
17
  reactElement: any; //CElement<any, any>;
18
+ domRoot: ReactDom.Root;
18
19
  };
19
20
 
20
21
  export type IStore = {
@@ -29,10 +30,27 @@ type ISubject = {
29
30
  domRoot: ReactDom.Root;
30
31
  };
31
32
 
32
- export default <ITestShape extends IBaseTest, IWhen, IGiven>(
33
+ export default <
34
+ I extends Ibdd_in<
35
+ IInput,
36
+ ISubject,
37
+ ISelection,
38
+ IStore,
39
+ (s: IStore) => IStore,
40
+ (s: IStore) => IStore,
41
+ (s: IStore) => IStore
42
+ >,
43
+ O extends Ibdd_out<
44
+ Record<string, any>,
45
+ Record<string, any>,
46
+ Record<string, any>,
47
+ Record<string, any>,
48
+ Record<string, any>
49
+ >
50
+ >(
33
51
  testInput: IInput,
34
- testSpecifications: ITestSpecification<ITestShape>,
35
- testImplementations: ITestImplementation<ITestShape, any>,
52
+ testSpecifications: ITestSpecification<I, O>,
53
+ testImplementations: ITestImplementation<I, O>,
36
54
  testInterface?: IPartialWebInterface<any>
37
55
  ) => {
38
56
  class TesterantoComponent extends testInput {
@@ -47,7 +65,7 @@ export default <ITestShape extends IBaseTest, IWhen, IGiven>(
47
65
  }
48
66
  }
49
67
 
50
- const t = Testeranto<ITestShape>(
68
+ const t = Testeranto<I, O>(
51
69
  testInput,
52
70
  testSpecifications,
53
71
  testImplementations,
@@ -86,19 +104,19 @@ export default <ITestShape extends IBaseTest, IWhen, IGiven>(
86
104
  );
87
105
  });
88
106
  },
89
- andWhen: function (s: IStore, whenCB): Promise<ISelection> {
107
+ andWhen: async function (s, whenCB) {
90
108
  return whenCB(s);
91
109
  },
92
- butThen: async function (s: IStore, thenCB): Promise<ISelection> {
110
+ butThen: async function (s, thenCB) {
93
111
  return thenCB(s);
94
112
  },
95
113
  afterEach:
96
114
  testInterface?.afterEach ||
97
- async function (store: IStore, ndx, artificer, utils) {
115
+ async function (store: IStore, ndx, utils) {
98
116
  return store;
99
117
  },
100
118
 
101
- afterAll: async (store: IStore, artificer, utils) => {
119
+ afterAll: async (store: IStore, utils) => {
102
120
  // setTimeout(() => {
103
121
  // console.log("This will run after 1 second");
104
122
  // }, 1000); // 1000 milliseconds = 1 second
@@ -1,68 +1,66 @@
1
1
  import { createElement } from "react";
2
- import { renderToStaticMarkup, renderToStaticNodeStream } from "react-dom/server";
3
- import Stream from 'stream'
2
+ import {
3
+ renderToStaticMarkup,
4
+ renderToStaticNodeStream,
5
+ } from "react-dom/server";
6
+ import Stream from "stream";
4
7
 
5
8
  import Testeranto from "../../../Node.js";
6
9
  import {
7
- IBaseTest,
10
+ Ibdd_in,
11
+ Ibdd_out,
8
12
  ITestImplementation,
9
- ITestSpecification
13
+ ITestSpecification,
10
14
  } from "../../../Types";
11
15
 
12
- export {
13
- renderToStaticMarkup, renderToStaticNodeStream, Stream
14
- }
15
-
16
- export default <ITestShape extends IBaseTest>(
16
+ import { IInput, ISelection, IStore } from "./index.js";
17
17
 
18
- testImplementations: ITestImplementation<ITestShape, any>,
19
- testSpecifications: ITestSpecification<ITestShape>,
20
- testInput: ITestShape['iinput']
18
+ export { renderToStaticMarkup, renderToStaticNodeStream, Stream };
21
19
 
20
+ export default <
21
+ I extends Ibdd_in<
22
+ IInput,
23
+ unknown,
24
+ ISelection,
25
+ IStore,
26
+ unknown,
27
+ unknown,
28
+ unknown
29
+ >,
30
+ O extends Ibdd_out<
31
+ Record<string, any>,
32
+ Record<string, any>,
33
+ Record<string, any>,
34
+ Record<string, any>,
35
+ Record<string, any>
36
+ >
37
+ >(
38
+ testImplementations: ITestImplementation<I, O>,
39
+ testSpecifications: ITestSpecification<I, O>,
40
+ testInput: I["iinput"]
22
41
  ) => {
23
- return Testeranto<
24
- ITestShape
25
- >(
26
- testInput,
27
- testSpecifications,
28
- testImplementations,
29
- {
30
- beforeAll: async (
31
- prototype,
32
- artificer
33
- ) => {
34
- return await new Promise((resolve, rej) => {
35
- resolve(null);
36
- })
37
- },
38
- beforeEach: async (
39
- reactComponent,
40
- ndx,
41
- testRsource,
42
- artificer
43
- ): Promise<ITestShape['istore']> => {
44
- return new Promise((resolve, rej) => {
45
- resolve(createElement(testInput));
46
- });
47
- },
48
- andWhen: async function (s, whenCB) {
49
- return s
50
- },
51
- butThen: async function (s: ITestShape['istore']): Promise<ITestShape['iselection']> {
52
- return s;
53
- },
54
- afterEach: async function (
55
- store: ITestShape['istore'],
56
- ndx,
57
- artificer
58
- ) {
59
- return {};
60
- },
61
- afterAll: (
62
- store: ITestShape['istore'],
63
- artificer) => {
64
- return;
65
- },
42
+ return Testeranto<I, O>(testInput, testSpecifications, testImplementations, {
43
+ beforeAll: async (prototype, artificer) => {
44
+ return await new Promise((resolve, rej) => {
45
+ resolve(null);
46
+ });
47
+ },
48
+ beforeEach: async () => {
49
+ return new Promise((resolve, rej) => {
50
+ resolve(createElement(testInput));
51
+ });
52
+ },
53
+ andWhen: async function (s, whenCB) {
54
+ return s;
55
+ },
56
+ butThen: async function (s: I["istore"]): Promise<I["iselection"]> {
57
+ return s;
58
+ },
59
+ afterEach: async function (store: I["istore"], ndx, artificer) {
60
+ return {};
61
+ },
62
+ afterAll: (store: I["istore"], artificer) => {
63
+ return;
66
64
  },
67
- )
65
+ });
68
66
  };
@@ -1,16 +1,22 @@
1
1
  import React, { useEffect, useRef } from "react";
2
2
  import { CElement, createElement } from "react";
3
3
  import ReactDom from "react-dom";
4
- import { createPortal } from "react-dom";
5
4
 
6
5
  import Testeranto from "../../../Web.js";
7
6
  import {
8
- IBaseTest,
7
+ Ibdd_in,
8
+ Ibdd_out,
9
9
  ITestImplementation,
10
10
  ITestSpecification,
11
11
  } from "../../../Types";
12
12
 
13
- import type { IInput, ISelection, IStore } from "./index";
13
+ import type {
14
+ IInput,
15
+ ISelection,
16
+ IStore,
17
+ IThenShape,
18
+ IWhenShape,
19
+ } from "./index";
14
20
 
15
21
  export type ISubject = HTMLElement;
16
22
 
@@ -30,12 +36,29 @@ const TesterantoComponent = ({
30
36
  return React.createElement("div", { ref: myContainer }, innerComp());
31
37
  };
32
38
 
33
- export default <ITestShape extends IBaseTest>(
34
- testImplementations: ITestImplementation<ITestShape>,
35
- testSpecifications: ITestSpecification<ITestShape>,
39
+ export default <
40
+ I extends Ibdd_in<
41
+ IInput,
42
+ ISubject,
43
+ ISelection,
44
+ IStore,
45
+ unknown,
46
+ IWhenShape,
47
+ IThenShape
48
+ >,
49
+ O extends Ibdd_out<
50
+ Record<string, any>,
51
+ Record<string, any>,
52
+ Record<string, any>,
53
+ Record<string, any>,
54
+ Record<string, any>
55
+ >
56
+ >(
57
+ testImplementations: ITestImplementation<I, O>,
58
+ testSpecifications: ITestSpecification<I, O>,
36
59
  testInput: IInput
37
60
  ) => {
38
- const t = Testeranto<ITestShape>(
61
+ const t = Testeranto<I, O>(
39
62
  testInput,
40
63
  testSpecifications,
41
64
  testImplementations,
@@ -70,36 +93,31 @@ export default <ITestShape extends IBaseTest>(
70
93
  });
71
94
  },
72
95
 
73
- beforeEach: async (
74
- subject,
75
- initializer,
76
- artificer,
77
- testResource,
78
- pm
79
- ): Promise<IStore> => {
80
- return new Promise((resolve, rej) => {
81
- resolve(subject);
82
- // const tc = TesterantoComponent({
83
- // innerComp: () =>
84
- // testInput({
85
- // port: 3003,
86
- // address: "some-address",
87
- // secretKey: "someSecretKey",
88
- // abi: "foo",
89
- // }),
90
- // done: (reactElement: any) => {
91
- // console.log("mark9");
92
- // resolve(reactElement);
93
- // // process.nextTick(() => {
94
- // // resolve(reactElement);
95
- // // });
96
- // },
97
- // });
98
- // console.log("mark9", tc);
99
- // createPortal(tc, subject.domRoot);
100
- });
96
+ beforeEach: async (subject) => {
97
+ return subject;
98
+ // return new Promise((resolve, rej) => {
99
+ // resolve(subject);
100
+ // // const tc = TesterantoComponent({
101
+ // // innerComp: () =>
102
+ // // testInput({
103
+ // // port: 3003,
104
+ // // address: "some-address",
105
+ // // secretKey: "someSecretKey",
106
+ // // abi: "foo",
107
+ // // }),
108
+ // // done: (reactElement: any) => {
109
+ // // console.log("mark9");
110
+ // // resolve(reactElement);
111
+ // // // process.nextTick(() => {
112
+ // // // resolve(reactElement);
113
+ // // // });
114
+ // // },
115
+ // // });
116
+ // // console.log("mark9", tc);
117
+ // // createPortal(tc, subject.domRoot);
118
+ // });
101
119
  },
102
- andWhen: function (s: IStore, whenCB, tr, utils): Promise<ISelection> {
120
+ andWhen: async function (s, whenCB, tr, utils) {
103
121
  return whenCB(s, utils);
104
122
  // return new Promise(async (resolve, rej) => {
105
123
  // // resolve(await whenCB(s, utils));
@@ -108,12 +126,7 @@ export default <ITestShape extends IBaseTest>(
108
126
  // // });
109
127
  // });
110
128
  },
111
- butThen: async function (
112
- s: IStore,
113
- thenCB,
114
- tr,
115
- utils
116
- ): Promise<ISelection> {
129
+ butThen: async function (s, thenCB, tr, utils) {
117
130
  return new Promise((resolve, rej) => {
118
131
  resolve(thenCB(s, utils));
119
132
  });
@@ -2,22 +2,38 @@ import React from "react";
2
2
  import renderer, { act } from "react-test-renderer";
3
3
 
4
4
  import {
5
- IBaseTest,
5
+ Ibdd_in,
6
+ Ibdd_out,
6
7
  ITestImplementation,
7
8
  ITestSpecification,
8
9
  } from "../../../Types";
9
10
  import test from "../../../Node";
10
11
 
11
12
  type IInput = React.MemoExoticComponent<() => JSX.Element>;
12
- type WhenShape = unknown;
13
- type ThenShape = unknown;
14
13
 
15
- export default <ITestShape extends IBaseTest, PropShape>(
16
- testImplementations: ITestImplementation<ITestShape>,
17
- testSpecifications: ITestSpecification<ITestShape>,
14
+ export default <
15
+ I extends Ibdd_in<
16
+ IInput,
17
+ renderer.ReactTestRenderer,
18
+ renderer.ReactTestRenderer,
19
+ renderer.ReactTestRenderer,
20
+ unknown,
21
+ unknown,
22
+ unknown
23
+ >,
24
+ O extends Ibdd_out<
25
+ Record<string, any>,
26
+ Record<string, any>,
27
+ Record<string, any>,
28
+ Record<string, any>,
29
+ Record<string, any>
30
+ >
31
+ >(
32
+ testImplementations: ITestImplementation<I, O>,
33
+ testSpecifications: ITestSpecification<I, O>,
18
34
  testInput: IInput
19
35
  ) =>
20
- test<ITestShape>(testInput, testSpecifications, testImplementations, {
36
+ test<I, O>(testInput, testSpecifications, testImplementations, {
21
37
  beforeEach: function (
22
38
  CComponent,
23
39
  props
@@ -2,7 +2,8 @@ import React from "react";
2
2
  import renderer, { act } from "react-test-renderer";
3
3
 
4
4
  import type {
5
- IBaseTest,
5
+ Ibdd_in,
6
+ Ibdd_out,
6
7
  ITestImplementation,
7
8
  ITestSpecification,
8
9
  } from "../../../Types";
@@ -17,7 +18,39 @@ export type ISelection = renderer.ReactTestRenderer;
17
18
  export type IStore = renderer.ReactTestRenderer;
18
19
  export type ISubject = renderer.ReactTestRenderer;
19
20
 
20
- export type IImpl<ITestShape extends IBaseTest> =
21
- ITestImplementation<ITestShape>;
22
- export type ISpec<ITestShape extends IBaseTest> =
23
- ITestSpecification<ITestShape>;
21
+ export type IImpl<
22
+ I extends Ibdd_in<
23
+ unknown,
24
+ unknown,
25
+ unknown,
26
+ unknown,
27
+ unknown,
28
+ unknown,
29
+ unknown
30
+ >,
31
+ O extends Ibdd_out<
32
+ Record<string, any>,
33
+ Record<string, any>,
34
+ Record<string, any>,
35
+ Record<string, any>,
36
+ Record<string, any>
37
+ >
38
+ > = ITestImplementation<I, O>;
39
+ export type ISpec<
40
+ I extends Ibdd_in<
41
+ unknown,
42
+ unknown,
43
+ unknown,
44
+ unknown,
45
+ unknown,
46
+ unknown,
47
+ unknown
48
+ >,
49
+ O extends Ibdd_out<
50
+ Record<string, any>,
51
+ Record<string, any>,
52
+ Record<string, any>,
53
+ Record<string, any>,
54
+ Record<string, any>
55
+ >
56
+ > = ITestSpecification<I, O>;
@@ -1,15 +1,34 @@
1
1
  import Testeranto from "../../../Node.js";
2
- import type { IBaseTest } from "../../../Types";
2
+ import { Ibdd_in, Ibdd_out } from "../../../Types.js";
3
3
 
4
4
  import { IImpl, ISpec, IInput } from "./index.js";
5
5
  import { testInterface } from "./interface.js";
6
6
 
7
- export default <ITestShape extends IBaseTest, IProps, IState>(
8
- testImplementations: IImpl<ITestShape>,
9
- testSpecifications: ISpec<ITestShape>,
7
+ export default <
8
+ I extends Ibdd_in<
9
+ unknown,
10
+ unknown,
11
+ unknown,
12
+ unknown,
13
+ unknown,
14
+ unknown,
15
+ unknown
16
+ >,
17
+ O extends Ibdd_out<
18
+ Record<string, any>,
19
+ Record<string, any>,
20
+ Record<string, any>,
21
+ Record<string, any>,
22
+ Record<string, any>
23
+ >,
24
+ IProps,
25
+ IState
26
+ >(
27
+ testImplementations: IImpl<I, O>,
28
+ testSpecifications: ISpec<I, O>,
10
29
  testInput: IInput<IProps, IState>
11
30
  ) =>
12
- Testeranto<ITestShape>(
31
+ Testeranto<I, O>(
13
32
  testInput,
14
33
  testSpecifications,
15
34
  testImplementations,
@@ -1,15 +1,32 @@
1
- import { IBaseTest } from "../../../Types";
1
+ import { Ibdd_in, Ibdd_out } from "../../../Types.js";
2
2
  import Testeranto from "../../../Web.js";
3
3
 
4
4
  import { IImpl, ISpec, IInput } from "./index.js";
5
5
  import { testInterface } from "./interface";
6
6
 
7
- export default <ITestShape extends IBaseTest, IProps, IState>(
8
- testImplementations: IImpl<ITestShape>,
9
- testSpecifications: ISpec<ITestShape>,
7
+ export default <
8
+ I extends Ibdd_in<
9
+ unknown,
10
+ unknown,
11
+ unknown,
12
+ unknown,
13
+ unknown,
14
+ unknown,
15
+ unknown
16
+ >,
17
+ O extends Ibdd_out<
18
+ Record<string, any>,
19
+ Record<string, any>,
20
+ Record<string, any>,
21
+ Record<string, any>,
22
+ Record<string, any>
23
+ >
24
+ >(
25
+ testImplementations: IImpl<I, O>,
26
+ testSpecifications: ISpec<I, O>,
10
27
  testInput: IInput<any, any>
11
28
  ) =>
12
- Testeranto<ITestShape>(
29
+ Testeranto<I, O>(
13
30
  testInput,
14
31
  testSpecifications,
15
32
  testImplementations,