testeranto 0.62.0 → 0.73.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 (186) hide show
  1. package/README.md +38 -26
  2. package/dist/cjs-shim.js +2 -2
  3. package/dist/common/Node.js +14 -51
  4. package/dist/common/PM/index.js +71 -0
  5. package/dist/common/PM/main.js +361 -0
  6. package/dist/common/PM/node.js +176 -0
  7. package/dist/common/PM/web.js +174 -0
  8. package/dist/common/Project.js +121 -266
  9. package/dist/common/Puppeteer.js +109 -0
  10. package/dist/common/Reporter.js +119 -0
  11. package/dist/common/Scheduler.js +1 -0
  12. package/dist/common/SubPackages/puppeteer.js +3 -1
  13. package/dist/common/SubPackages/react-dom/component/web.js +98 -45
  14. package/dist/common/SubPackages/react-dom/jsx/web.js +15 -7
  15. package/dist/common/SubPackages/react-test-renderer/MemoExoticComponent/node.js +1 -1
  16. package/dist/common/SubPackages/react-test-renderer/component/index.js +0 -1
  17. package/dist/common/SubPackages/react-test-renderer/fc/web.js +1 -1
  18. package/dist/common/SubPackages/react-test-renderer/jsx/index.js +1 -3
  19. package/dist/common/SubPackages/react-test-renderer/jsx/web.js +1 -1
  20. package/dist/common/SubPackages/react-test-renderer/jsx-promised/index.js +1 -1
  21. package/dist/common/Types.js +2 -32
  22. package/dist/common/Web.js +25 -37
  23. package/dist/common/esbuildConfigs/index.js +5 -5
  24. package/dist/common/esbuildConfigs/node.js +17 -15
  25. package/dist/common/esbuildConfigs/report.js +12 -47
  26. package/dist/common/esbuildConfigs/tests.js +0 -1
  27. package/dist/common/esbuildConfigs/web.js +17 -12
  28. package/dist/common/lib/abstractBase.js +190 -35
  29. package/dist/common/lib/basebuilder.js +56 -29
  30. package/dist/common/lib/classBuilder.js +8 -5
  31. package/dist/common/lib/core.js +42 -17
  32. package/dist/common/lib/index.js +11 -8
  33. package/dist/common/lib/types.js +2 -0
  34. package/dist/common/preload.js +14 -28
  35. package/dist/common/puppeteerConfiger.js +24 -0
  36. package/dist/common/tsconfig.common.tsbuildinfo +1 -1
  37. package/dist/module/Node.js +14 -51
  38. package/dist/module/PM/index.js +67 -0
  39. package/dist/module/PM/main.js +331 -0
  40. package/dist/module/PM/node.js +168 -0
  41. package/dist/module/PM/web.js +167 -0
  42. package/dist/module/Project.js +122 -267
  43. package/dist/module/Puppeteer.js +104 -0
  44. package/dist/module/Reporter.js +114 -0
  45. package/dist/module/Scheduler.js +1 -0
  46. package/dist/module/SubPackages/puppeteer.js +3 -1
  47. package/dist/module/SubPackages/react/jsx/node.js +1 -1
  48. package/dist/module/SubPackages/react/jsx/web.js +1 -1
  49. package/dist/module/SubPackages/react-dom/component/node.js +2 -2
  50. package/dist/module/SubPackages/react-dom/component/web.js +98 -45
  51. package/dist/module/SubPackages/react-dom/jsx/web.js +17 -9
  52. package/dist/module/SubPackages/react-test-renderer/MemoExoticComponent/node.js +1 -1
  53. package/dist/module/SubPackages/react-test-renderer/component/index.js +0 -1
  54. package/dist/module/SubPackages/react-test-renderer/fc/web.js +1 -1
  55. package/dist/module/SubPackages/react-test-renderer/jsx/index.js +1 -3
  56. package/dist/module/SubPackages/react-test-renderer/jsx/web.js +1 -1
  57. package/dist/module/SubPackages/react-test-renderer/jsx-promised/index.js +1 -1
  58. package/dist/module/Types.js +3 -30
  59. package/dist/module/Web.js +26 -38
  60. package/dist/module/esbuildConfigs/index.js +5 -5
  61. package/dist/module/esbuildConfigs/node.js +17 -15
  62. package/dist/module/esbuildConfigs/report.js +11 -48
  63. package/dist/module/esbuildConfigs/tests.js +0 -1
  64. package/dist/module/esbuildConfigs/web.js +17 -12
  65. package/dist/module/lib/abstractBase.js +190 -35
  66. package/dist/module/lib/basebuilder.js +56 -29
  67. package/dist/module/lib/classBuilder.js +8 -5
  68. package/dist/module/lib/core.js +44 -19
  69. package/dist/module/lib/index.js +11 -8
  70. package/dist/module/preload.js +15 -27
  71. package/dist/module/puppeteerConfiger.js +19 -0
  72. package/dist/module/tsconfig.module.tsbuildinfo +1 -1
  73. package/dist/prebuild/Report.css +1616 -584
  74. package/dist/prebuild/Report.js +2635 -2506
  75. package/dist/types/Node.d.ts +3 -2
  76. package/dist/types/PM/index.d.ts +19 -0
  77. package/dist/types/PM/main.d.ts +28 -0
  78. package/dist/types/PM/node.d.ts +26 -0
  79. package/dist/types/PM/web.d.ts +24 -0
  80. package/dist/types/Project.d.ts +1 -2
  81. package/dist/types/Puppeteer.d.ts +1 -0
  82. package/dist/types/Reporter.d.ts +1 -0
  83. package/dist/types/Scheduler.d.ts +0 -0
  84. package/dist/types/SubPackages/puppeteer.d.ts +3 -3
  85. package/dist/types/SubPackages/react/component/node.d.ts +1 -1
  86. package/dist/types/SubPackages/react/component/web.d.ts +1 -1
  87. package/dist/types/SubPackages/react/jsx/index.d.ts +1 -1
  88. package/dist/types/SubPackages/react/jsx/node.d.ts +1 -1
  89. package/dist/types/SubPackages/react/jsx/web.d.ts +2 -2
  90. package/dist/types/SubPackages/react-dom/component/node.d.ts +2 -2
  91. package/dist/types/SubPackages/react-dom/component/web.d.ts +1 -1
  92. package/dist/types/SubPackages/react-dom/jsx/node.d.ts +1 -1
  93. package/dist/types/SubPackages/react-dom/jsx/web.d.ts +1 -1
  94. package/dist/types/SubPackages/react-test-renderer/MemoExoticComponent/node.d.ts +1 -1
  95. package/dist/types/SubPackages/react-test-renderer/component/index.d.ts +1 -1
  96. package/dist/types/SubPackages/react-test-renderer/component/node.d.ts +1 -1
  97. package/dist/types/SubPackages/react-test-renderer/component/web.d.ts +1 -1
  98. package/dist/types/SubPackages/react-test-renderer/fc/node.d.ts +1 -1
  99. package/dist/types/SubPackages/react-test-renderer/fc/web.d.ts +1 -1
  100. package/dist/types/SubPackages/react-test-renderer/jsx/node.d.ts +1 -1
  101. package/dist/types/SubPackages/react-test-renderer/jsx/web.d.ts +3 -3
  102. package/dist/types/SubPackages/react-test-renderer/jsx-promised/index.d.ts +1 -1
  103. package/dist/types/SubPackages/react-test-renderer/jsx-promised/node.d.ts +1 -1
  104. package/dist/types/SubPackages/react-test-renderer/jsx-promised/web.d.ts +1 -1
  105. package/dist/types/Types.d.ts +19 -100
  106. package/dist/types/Web.d.ts +3 -2
  107. package/dist/types/esbuildConfigs/features.d.ts +1 -1
  108. package/dist/types/esbuildConfigs/index.d.ts +1 -1
  109. package/dist/types/esbuildConfigs/node.d.ts +1 -1
  110. package/dist/types/esbuildConfigs/report.d.ts +4 -0
  111. package/dist/types/esbuildConfigs/tests.d.ts +1 -1
  112. package/dist/types/esbuildConfigs/web.d.ts +1 -1
  113. package/dist/types/lib/abstractBase.d.ts +26 -24
  114. package/dist/types/lib/basebuilder.d.ts +10 -7
  115. package/dist/types/lib/classBuilder.d.ts +4 -3
  116. package/dist/types/lib/core.d.ts +5 -4
  117. package/dist/types/lib/index.d.ts +7 -5
  118. package/dist/types/lib/types.d.ts +62 -0
  119. package/dist/types/preload.d.ts +0 -1
  120. package/dist/types/puppeteerConfiger.d.ts +4 -0
  121. package/dist/types/tsconfig.types.tsbuildinfo +1 -1
  122. package/package.json +6 -7
  123. package/src/Node.ts +30 -85
  124. package/src/PM/index.ts +102 -0
  125. package/src/PM/main.ts +420 -0
  126. package/src/PM/node.ts +515 -0
  127. package/src/PM/web.ts +497 -0
  128. package/src/Project.ts +183 -619
  129. package/src/Puppeteer.ts +131 -0
  130. package/src/Report.tsx +158 -44
  131. package/src/Reporter.ts +134 -0
  132. package/src/Scheduler.ts +0 -0
  133. package/src/SubPackages/puppeteer.ts +19 -14
  134. package/src/SubPackages/react/component/node.ts +20 -32
  135. package/src/SubPackages/react/component/web.ts +20 -30
  136. package/src/SubPackages/react/jsx/index.ts +13 -24
  137. package/src/SubPackages/react/jsx/node.ts +5 -8
  138. package/src/SubPackages/react/jsx/web.ts +10 -8
  139. package/src/SubPackages/react-dom/component/node.ts +17 -23
  140. package/src/SubPackages/react-dom/component/web.ts +134 -95
  141. package/src/SubPackages/react-dom/jsx/web.ts +41 -48
  142. package/src/SubPackages/react-test-renderer/MemoExoticComponent/node.ts +27 -37
  143. package/src/SubPackages/react-test-renderer/component/index.ts +16 -30
  144. package/src/SubPackages/react-test-renderer/component/node.ts +5 -11
  145. package/src/SubPackages/react-test-renderer/component/web.ts +5 -11
  146. package/src/SubPackages/react-test-renderer/fc/node.ts +36 -50
  147. package/src/SubPackages/react-test-renderer/fc/web.ts +37 -50
  148. package/src/SubPackages/react-test-renderer/jsx/index.ts +15 -21
  149. package/src/SubPackages/react-test-renderer/jsx/node.ts +6 -10
  150. package/src/SubPackages/react-test-renderer/jsx/web.ts +7 -7
  151. package/src/SubPackages/react-test-renderer/jsx-promised/index.ts +13 -16
  152. package/src/Types.ts +73 -307
  153. package/src/Web.ts +40 -81
  154. package/src/cjs-shim.js +2 -2
  155. package/src/esbuildConfigs/features.ts +3 -4
  156. package/src/esbuildConfigs/index.ts +8 -8
  157. package/src/esbuildConfigs/node.ts +21 -20
  158. package/src/esbuildConfigs/report.ts +15 -51
  159. package/src/esbuildConfigs/tests.ts +3 -9
  160. package/src/esbuildConfigs/web.ts +22 -20
  161. package/src/lib/abstractBase.ts +312 -164
  162. package/src/lib/basebuilder.ts +123 -127
  163. package/src/lib/classBuilder.ts +30 -48
  164. package/src/lib/core.ts +115 -84
  165. package/src/lib/index.ts +58 -56
  166. package/src/lib/types.ts +197 -0
  167. package/src/preload.ts +14 -30
  168. package/src/puppeteerConfiger.ts +26 -0
  169. package/src/web.html.ts +1 -1
  170. package/dist/common/NodeWriter.js +0 -56
  171. package/dist/common/electron.js +0 -196
  172. package/dist/common/lib/browser.js +0 -26
  173. package/dist/common/nodeWriterElectron.js +0 -55
  174. package/dist/module/NodeWriter.js +0 -50
  175. package/dist/module/electron.js +0 -191
  176. package/dist/module/lib/browser.js +0 -22
  177. package/dist/module/nodeWriterElectron.js +0 -52
  178. package/dist/types/NodeWriter.d.ts +0 -2
  179. package/dist/types/lib/browser.d.ts +0 -6
  180. package/dist/types/nodeWriterElectron.d.ts +0 -2
  181. package/src/NodeWriter.ts +0 -69
  182. package/src/electron.ts +0 -250
  183. package/src/lib/browser.ts +0 -34
  184. package/src/nodeWriterElectron.ts +0 -71
  185. package/yarn-error.log +0 -3144
  186. /package/dist/{types/electron.d.ts → module/lib/types.js} +0 -0
@@ -1,45 +1,43 @@
1
+ import { PassThrough } from "stream";
2
+
3
+ import {
4
+ ITTestResourceRequest,
5
+ ITestJob,
6
+ ITLog,
7
+ ILogWriter,
8
+ ITTestResourceConfiguration,
9
+ } from ".";
10
+ import { IBaseTest, ITestSpecification } from "../Types.js";
1
11
 
2
12
  import {
3
- IBaseTest,
4
- ICheckKlasser,
5
- IGivenKlasser,
6
13
  ISuiteKlasser,
7
- ITestSpecification,
14
+ IGivenKlasser,
15
+ IWhenKlasser,
8
16
  IThenKlasser,
9
- IUtils,
10
- IWhenKlasser
11
- } from "../Types";
17
+ ICheckKlasser,
18
+ // IUtils,
19
+ } from "./types.js";
12
20
 
13
21
  import {
14
-
15
22
  BaseCheck,
16
23
  BaseSuite,
17
24
  BaseWhen,
18
25
  BaseThen,
19
- BaseGiven
26
+ BaseGiven,
20
27
  } from "./abstractBase.js";
28
+ import { PM } from "../PM/index.js";
21
29
 
22
- import {
23
- ITTestResourceRequest,
24
- ITestJob,
25
- ITLog,
26
- ILogWriter,
27
- ITTestResourceConfiguration,
28
- } from ".";
29
30
  export abstract class BaseBuilder<
30
31
  ITestShape extends IBaseTest,
31
32
  SuiteExtensions,
32
33
  GivenExtensions,
33
34
  WhenExtensions,
34
35
  ThenExtensions,
35
- CheckExtensions,
36
+ CheckExtensions
36
37
  > {
37
-
38
38
  specs: any;
39
39
 
40
- assertThis: (t: any) => {
41
-
42
- }
40
+ assertThis: (t: ITestShape["then"]) => {};
43
41
 
44
42
  testResourceRequirement: ITTestResourceRequest;
45
43
  artifacts: Promise<unknown>[] = [];
@@ -50,17 +48,18 @@ export abstract class BaseBuilder<
50
48
  whenOverides: Record<keyof WhenExtensions, IWhenKlasser<ITestShape>>;
51
49
  thenOverides: Record<keyof ThenExtensions, IThenKlasser<ITestShape>>;
52
50
  checkOverides: Record<keyof CheckExtensions, ICheckKlasser<ITestShape>>;
51
+ puppetMaster: PM;
53
52
 
54
53
  constructor(
55
- public readonly input: ITestShape['iinput'],
54
+ public readonly input: ITestShape["iinput"],
56
55
  suitesOverrides: Record<keyof SuiteExtensions, ISuiteKlasser<ITestShape>>,
57
56
  givenOverides: Record<keyof GivenExtensions, IGivenKlasser<ITestShape>>,
58
57
  whenOverides: Record<keyof WhenExtensions, IWhenKlasser<ITestShape>>,
59
58
  thenOverides: Record<keyof ThenExtensions, IThenKlasser<ITestShape>>,
60
59
  checkOverides: Record<keyof CheckExtensions, ICheckKlasser<ITestShape>>,
61
- logWriter: ILogWriter,
62
60
  testResourceRequirement: ITTestResourceRequest,
63
- testSpecification: any,
61
+ testSpecification: any
62
+ // puppetMaster: PM
64
63
  ) {
65
64
  this.artifacts = [];
66
65
  this.testResourceRequirement = testResourceRequirement;
@@ -70,53 +69,52 @@ export abstract class BaseBuilder<
70
69
  this.thenOverides = thenOverides;
71
70
  this.checkOverides = checkOverides;
72
71
  this.testSpecification = testSpecification;
72
+ // this.puppetMaster = puppetMaster;
73
73
 
74
74
  this.specs = testSpecification(
75
75
  this.Suites(),
76
76
  this.Given(),
77
77
  this.When(),
78
78
  this.Then(),
79
- this.Check(),
79
+ this.Check()
80
80
  );
81
81
 
82
- const suiteRunner = (
83
- suite: BaseSuite<ITestShape>,
84
- utils: IUtils
85
- ) =>
86
- async (
87
- testResourceConfiguration: ITTestResourceConfiguration,
88
- tLog: ITLog,
89
- utils: IUtils
90
- ): Promise<BaseSuite<
91
- ITestShape
92
- >> => {
93
- return await suite.run(
94
- input,
95
- testResourceConfiguration,
96
- (
97
- fPath: string,
98
- value: unknown
99
- ) =>
100
- logWriter.testArtiFactoryfileWriter(tLog, (p: Promise<void>) => {
101
- this.artifacts.push(p);
102
- })(
103
- testResourceConfiguration.fs + "/" + fPath,
104
- value
105
- ),
106
- tLog,
107
- utils
108
- );
109
- };
82
+ this.testJobs = this.specs.map((suite: BaseSuite<ITestShape>) => {
83
+ const suiteRunner =
84
+ (suite: BaseSuite<ITestShape>) =>
85
+ async (
86
+ // testResourceConfiguration: ITTestResourceConfiguration,
87
+ puppetMaster: PM,
88
+ tLog: ITLog
89
+ ): Promise<BaseSuite<ITestShape>> => {
90
+ await puppetMaster.startPuppeteer(
91
+ {
92
+ browserWSEndpoint:
93
+ puppetMaster.testResourceConfiguration.browserWSEndpoint,
94
+ },
95
+ puppetMaster.testResourceConfiguration.fs
96
+ );
97
+
98
+ return await suite.run(
99
+ input,
100
+ puppetMaster.testResourceConfiguration,
101
+ (fPath: string, value: string | Buffer | PassThrough) =>
102
+ puppetMaster.testArtiFactoryfileWriter(
103
+ tLog,
104
+ (p: Promise<void>) => {
105
+ this.artifacts.push(p);
106
+ }
107
+ )(puppetMaster.testResourceConfiguration.fs + "/" + fPath, value),
108
+ tLog,
109
+ puppetMaster
110
+ );
111
+ };
110
112
 
111
- this.testJobs = this.specs.map((
112
- suite: BaseSuite<ITestShape>,
113
- utils: IUtils
114
- ) => {
115
- const runner = suiteRunner(suite, utils);
113
+ const runner = suiteRunner(suite);
116
114
 
117
115
  return {
118
116
  test: suite,
119
- testResourceRequirement,
117
+ // testResourceRequirement,
120
118
 
121
119
  toObj: () => {
122
120
  return suite.toObj();
@@ -125,63 +123,74 @@ export abstract class BaseBuilder<
125
123
  runner,
126
124
 
127
125
  receiveTestResourceConfig: async function (
128
- testResourceConfiguration = {
129
- name: "",
130
- fs: ".",
131
- ports: [],
132
- scheduled: false
133
- },
134
- y: IUtils
126
+ // testResourceConfiguration = {
127
+ // name: "",
128
+ // fs: ".",
129
+ // ports: [],
130
+ // browserWSEndpoint: "",
131
+ // },
132
+ puppetMaster: PM
135
133
  ) {
136
- console.log(
137
- `testResourceConfiguration ${JSON.stringify(
138
- testResourceConfiguration,
139
- null,
140
- 2
141
- )}`
142
- );
143
- await logWriter.mkdirSync(testResourceConfiguration.fs);
144
- logWriter.writeFileSync(
145
- `${testResourceConfiguration.fs}/tests.json`,
146
- JSON.stringify(this.toObj(), null, 2)
147
- );
148
-
149
- const logFilePath = `${testResourceConfiguration.fs}/log.txt`;
150
-
151
- const access = await logWriter.createWriteStream(logFilePath);
152
-
134
+ // console.log(
135
+ // `testResourceConfiguration! ${JSON.stringify(
136
+ // testResourceConfiguration,
137
+ // null,
138
+ // 2
139
+ // )}`
140
+ // );
141
+ // console.log("puppetMaster", puppetMaster);
142
+
143
+ await puppetMaster
144
+ .mkdirSync
145
+ // ""
146
+ // puppetMaster.testResourceConfiguration.fs + "/"
147
+ ();
148
+ // if (!puppetMaster.existsSync(destFolder)) {
149
+ // puppetMaster.mkdirSync(destFolder, { recursive: true });
150
+ // }
151
+
152
+ // puppetMaster.writeFileSync(
153
+ // // puppetMaster.testResourceConfiguration.fs + `/tests.json`,
154
+ // `tests.json`,
155
+ // JSON.stringify(this.toObj(), null, 2)
156
+ // );
157
+
158
+ const logFilePath = "log.txt";
159
+ // puppetMaster.testResourceConfiguration.fs + `/log.txt`;
160
+
161
+ const access = await puppetMaster.createWriteStream(logFilePath);
162
+
163
+ // console.log("access", access);
153
164
  const tLog = (...l: string[]) => {
154
- // console.log(...l);
155
- access.write(`${l.toString()}\n`);
165
+ // access.write(`${l.toString()}\n`);
166
+ // console.log("tLog", l);
167
+ puppetMaster.write(access, `${l.toString()}\n`);
156
168
  };
157
- const suiteDone: BaseSuite<
158
- ITestShape
159
- > = await runner(testResourceConfiguration, tLog, y);
160
- const resultsFilePath = (
161
- `${testResourceConfiguration.fs}/results.json`
162
- );
163
169
 
164
- logWriter.writeFileSync(
165
- resultsFilePath,
166
- JSON.stringify(suiteDone.toObj(), null, 2)
170
+ const suiteDone: BaseSuite<ITestShape> = await runner(
171
+ puppetMaster,
172
+ tLog
167
173
  );
168
174
 
169
175
  const logPromise = new Promise((res, rej) => {
170
- access.on("finish", () => { res(true); });
171
- })
172
- access.end();
173
-
174
- const numberOfFailures = Object.keys(suiteDone.givens).filter(
175
- (k) => {
176
- // console.log(`suiteDone.givens[k].error`, suiteDone.givens[k].error);
177
- return suiteDone.givens[k].error
178
- }
179
- ).length;
176
+ puppetMaster.end(access);
177
+ res(true);
178
+ });
179
+
180
+ const numberOfFailures = Object.keys(suiteDone.givens).filter((k) => {
181
+ return suiteDone.givens[k].error;
182
+ }).length;
183
+ puppetMaster.writeFileSync(`exitcode`, numberOfFailures.toString());
184
+
185
+ puppetMaster.writeFileSync(
186
+ `tests.json`,
187
+ JSON.stringify(this.toObj(), null, 2)
188
+ );
180
189
  console.log(`exiting gracefully with ${numberOfFailures} failures.`);
181
190
  return {
182
191
  failed: numberOfFailures,
183
192
  artifacts: this.artifacts || [],
184
- logPromise
193
+ logPromise,
185
194
  };
186
195
  },
187
196
  };
@@ -200,26 +209,17 @@ export abstract class BaseBuilder<
200
209
  (
201
210
  name: string,
202
211
  features: string[],
203
- whens: BaseWhen<
204
- ITestShape
205
- >[],
206
- thens: BaseThen<
207
- ITestShape
208
- >[],
209
- gcb,
210
- ) => BaseGiven<
211
- ITestShape
212
- >
212
+ whens: BaseWhen<ITestShape>[],
213
+ thens: BaseThen<ITestShape>[],
214
+ gcb
215
+ ) => BaseGiven<ITestShape>
213
216
  > {
214
217
  return this.givenOverides;
215
218
  }
216
219
 
217
220
  When(): Record<
218
221
  keyof WhenExtensions,
219
- (arg0: ITestShape['istore'], ...arg1: any) =>
220
- BaseWhen<
221
- ITestShape
222
- >
222
+ (arg0: ITestShape["istore"], ...arg1: any) => BaseWhen<ITestShape>
223
223
  > {
224
224
  return this.whenOverides;
225
225
  }
@@ -227,11 +227,9 @@ export abstract class BaseBuilder<
227
227
  Then(): Record<
228
228
  keyof ThenExtensions,
229
229
  (
230
- selection: ITestShape['iselection'],
230
+ selection: ITestShape["iselection"],
231
231
  expectation: any
232
- ) => BaseThen<
233
- ITestShape
234
- >
232
+ ) => BaseThen<ITestShape>
235
233
  > {
236
234
  return this.thenOverides;
237
235
  }
@@ -244,10 +242,8 @@ export abstract class BaseBuilder<
244
242
  whens,
245
243
  thens,
246
244
  x
247
- ) => BaseCheck<
248
- ITestShape
249
- >
245
+ ) => BaseCheck<ITestShape>
250
246
  > {
251
247
  return this.checkOverides;
252
248
  }
253
- }
249
+ }
@@ -1,46 +1,35 @@
1
- import type {
1
+ import {
2
2
  IBaseTest,
3
- ICheckKlasser,
4
- IGivenKlasser,
5
- ISuiteKlasser,
6
3
  ITestImplementation,
7
4
  ITestSpecification,
8
- IThenKlasser,
9
- IWhenKlasser,
10
- } from "../Types";
5
+ } from "../Types.js";
11
6
 
7
+ import { BaseBuilder } from "./basebuilder.js";
12
8
 
13
9
  import {
14
- BaseBuilder
15
- } from "./basebuilder.js";
16
-
17
- import {
18
- ILogWriter,
19
- ITTestResourceRequest
20
- } from ".";
10
+ ISuiteKlasser,
11
+ IGivenKlasser,
12
+ IWhenKlasser,
13
+ IThenKlasser,
14
+ ICheckKlasser,
15
+ } from "./types.js";
16
+ import { PM } from "../PM/index.js";
17
+ import { ITTestResourceRequest } from "./index.js";
21
18
 
22
19
  export abstract class ClassBuilder<
23
20
  ITestShape extends IBaseTest
24
- > extends BaseBuilder<
25
- ITestShape,
26
- any,
27
- any,
28
- any,
29
- any,
30
- any
31
- > {
32
-
21
+ > extends BaseBuilder<ITestShape, any, any, any, any, any> {
33
22
  constructor(
34
23
  testImplementation: ITestImplementation<ITestShape, any>,
35
24
  testSpecification: ITestSpecification<ITestShape>,
36
- input: ITestShape['iinput'],
25
+ input: ITestShape["iinput"],
37
26
  suiteKlasser: ISuiteKlasser<ITestShape>,
38
27
  givenKlasser: IGivenKlasser<ITestShape>,
39
28
  whenKlasser: IWhenKlasser<ITestShape>,
40
29
  thenKlasser: IThenKlasser<ITestShape>,
41
30
  checkKlasser: ICheckKlasser<ITestShape>,
42
- testResourceRequirement: ITTestResourceRequest,
43
- logWriter: ILogWriter
31
+ testResourceRequirement: ITTestResourceRequest
32
+ // puppetMaster: PM
44
33
  ) {
45
34
  const classySuites = Object.entries(testImplementation.suites).reduce(
46
35
  (a, [key], index) => {
@@ -56,28 +45,22 @@ export abstract class ClassBuilder<
56
45
  },
57
46
  {}
58
47
  );
59
- const classyGivens = Object.entries(testImplementation.givens)
60
- .reduce(
61
- (a, [key, givEn]) => {
62
- a[key] = (
48
+ const classyGivens = Object.entries(testImplementation.givens).reduce(
49
+ (a, [key, givEn]) => {
50
+ a[key] = (features, whens, thens, givEn) => {
51
+ return new givenKlasser.prototype.constructor(
52
+ key,
63
53
  features,
64
54
  whens,
65
55
  thens,
66
- givEn,
67
- ) => {
68
- return new (givenKlasser.prototype).constructor(
69
- key,
70
- features,
71
- whens,
72
- thens,
73
- testImplementation.givens[key],
74
- givEn
75
- );
76
- };
77
- return a;
78
- },
79
- {}
80
- );
56
+ testImplementation.givens[key],
57
+ givEn
58
+ );
59
+ };
60
+ return a;
61
+ },
62
+ {}
63
+ );
81
64
 
82
65
  const classyWhens = Object.entries(testImplementation.whens).reduce(
83
66
  (a, [key, whEn]: [string, (x) => any]) => {
@@ -128,10 +111,9 @@ export abstract class ClassBuilder<
128
111
  classyWhens,
129
112
  classyThens,
130
113
  classyChecks,
131
- logWriter,
132
114
  testResourceRequirement,
133
115
  testSpecification
116
+ // puppetMaster
134
117
  );
135
118
  }
136
-
137
- }
119
+ }