testeranto 0.85.0 → 0.94.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 (98) hide show
  1. package/README.md +1 -3
  2. package/bin/init-docs.js +24 -0
  3. package/bundle.js +53 -0
  4. package/dist/common/dist/module/src/Init.js +40 -0
  5. package/dist/common/src/Init.js +30 -0
  6. package/dist/common/src/Node.js +5 -3
  7. package/dist/common/src/PM/main.js +136 -90
  8. package/dist/common/src/Project.js +82 -0
  9. package/dist/common/src/Puppeteer.js +0 -2
  10. package/dist/common/src/SubPackages/puppeteer.js +1 -1
  11. package/dist/common/src/SubPackages/react/jsx/index.js +14 -6
  12. package/dist/common/src/SubPackages/react/jsx/node.js +7 -2
  13. package/dist/common/src/SubPackages/react-dom/component/web.js +13 -39
  14. package/dist/common/src/SubPackages/react-test-renderer/component/interface.js +2 -10
  15. package/dist/common/src/Web.js +25 -21
  16. package/dist/common/{run-tests.js → src/build-tests.js} +10 -5
  17. package/dist/common/src/defaultConfig.js +19 -0
  18. package/dist/common/src/esbuildConfigs/inputFilesPlugin.js +26 -16
  19. package/dist/common/src/init-docs.js +43 -0
  20. package/dist/common/src/lib/abstractBase.js +29 -248
  21. package/dist/common/src/lib/basebuilder.js +1 -11
  22. package/dist/common/src/lib/classBuilder.js +1 -1
  23. package/dist/common/src/lib/core.js +8 -26
  24. package/dist/common/{build-tests.js → src/run-tests.js} +10 -9
  25. package/dist/common/tsconfig.common.tsbuildinfo +1 -1
  26. package/dist/module/src/Init.js +30 -0
  27. package/dist/module/src/Node.js +5 -3
  28. package/dist/module/src/PM/main.js +136 -90
  29. package/dist/module/src/Project.js +82 -0
  30. package/dist/module/src/Puppeteer.js +0 -2
  31. package/dist/module/src/SubPackages/puppeteer.js +1 -1
  32. package/dist/module/src/SubPackages/react/jsx/index.js +14 -6
  33. package/dist/module/src/SubPackages/react/jsx/node.js +7 -2
  34. package/dist/module/src/SubPackages/react-dom/component/web.js +13 -39
  35. package/dist/module/src/SubPackages/react-test-renderer/component/interface.js +2 -10
  36. package/dist/module/src/Web.js +25 -21
  37. package/dist/module/src/build-tests.js +11 -0
  38. package/dist/module/src/defaultConfig.js +17 -0
  39. package/dist/module/src/esbuildConfigs/inputFilesPlugin.js +26 -16
  40. package/dist/module/src/init-docs.js +15 -0
  41. package/dist/module/src/lib/abstractBase.js +29 -248
  42. package/dist/module/src/lib/basebuilder.js +1 -11
  43. package/dist/module/src/lib/classBuilder.js +1 -1
  44. package/dist/module/src/lib/core.js +8 -26
  45. package/dist/module/src/run-tests.js +11 -0
  46. package/dist/module/tsconfig.module.tsbuildinfo +1 -1
  47. package/dist/prebuild/build-tests.mjs +553 -0
  48. package/dist/prebuild/init-docs.mjs +48 -0
  49. package/dist/prebuild/run-tests.mjs +871 -0
  50. package/dist/types/dist/module/src/Init.d.ts +2 -0
  51. package/dist/types/src/Node.d.ts +4 -1
  52. package/dist/types/src/PM/main.d.ts +2 -1
  53. package/dist/types/src/SubPackages/react/jsx/node.d.ts +1 -1
  54. package/dist/types/src/SubPackages/react-test-renderer/component/interface.d.ts +1 -1
  55. package/dist/types/src/Web.d.ts +2 -2
  56. package/dist/types/src/build-tests.d.ts +1 -0
  57. package/dist/types/src/defaultConfig.d.ts +3 -0
  58. package/dist/types/src/init-docs.d.ts +1 -0
  59. package/dist/types/src/lib/abstractBase.d.ts +6 -2
  60. package/dist/types/src/lib/core.d.ts +3 -3
  61. package/dist/types/src/lib/types.d.ts +5 -1
  62. package/dist/types/src/run-tests.d.ts +1 -0
  63. package/dist/types/tsconfig.types.tsbuildinfo +1 -1
  64. package/package.json +21 -24
  65. package/src/Init.ts +28 -0
  66. package/src/Node.ts +6 -3
  67. package/src/PM/main.ts +168 -110
  68. package/src/Project.ts +103 -0
  69. package/src/Puppeteer.ts +0 -2
  70. package/src/SubPackages/puppeteer.ts +1 -1
  71. package/src/SubPackages/react/jsx/index.ts +15 -7
  72. package/src/SubPackages/react/jsx/node.ts +6 -5
  73. package/src/SubPackages/react-dom/component/web.ts +28 -51
  74. package/src/SubPackages/react-test-renderer/component/interface.ts +4 -11
  75. package/src/Web.ts +45 -23
  76. package/src/build-tests.ts +12 -0
  77. package/src/defaultConfig.ts +20 -0
  78. package/src/esbuildConfigs/inputFilesPlugin.ts +46 -17
  79. package/src/init-docs.ts +19 -0
  80. package/src/lib/abstractBase.ts +38 -255
  81. package/src/lib/basebuilder.ts +1 -12
  82. package/src/lib/classBuilder.ts +2 -1
  83. package/src/lib/core.ts +17 -29
  84. package/src/lib/types.ts +3 -1
  85. package/src/run-tests.ts +12 -0
  86. package/tsconfig.json +1 -1
  87. package/build-tests.ts +0 -16
  88. package/dist/common/init-docs.js +0 -8
  89. package/dist/module/build-tests.js +0 -10
  90. package/dist/module/init-docs.js +0 -3
  91. package/dist/module/run-tests.js +0 -6
  92. package/dist/prebuild/Puppeteer.mjs +0 -82033
  93. package/dist/types/build-tests.d.ts +0 -3
  94. package/dist/types/init-docs.d.ts +0 -2
  95. package/dist/types/run-tests.d.ts +0 -2
  96. package/init-docs.ts +0 -5
  97. package/pupBuild.js +0 -18
  98. package/run-tests.ts +0 -9
@@ -44,11 +44,12 @@ class BaseSuite {
44
44
  this.testResourceConfiguration = testResourceConfiguration;
45
45
  tLog("test resources: ", JSON.stringify(testResourceConfiguration));
46
46
  const suiteArtifactory = (fPath, value) => artifactory(`suite-${this.index}-${this.name}/${fPath}`, value);
47
- console.log("\nSuite:", this.index, this.name);
47
+ // console.log("\nSuite:", this.index, this.name);
48
48
  tLog("\nSuite:", this.index, this.name);
49
49
  const sNdx = this.index;
50
50
  const sName = this.name;
51
- for (const [gNdx, g] of Object.entries(this.givens)) {
51
+ for (const [gKey, g] of Object.entries(this.givens)) {
52
+ // console.log("gKey", gKey);
52
53
  const beforeAllProxy = new Proxy(pm, {
53
54
  get(target, prop, receiver) {
54
55
  if (prop === "customScreenShot") {
@@ -59,65 +60,13 @@ class BaseSuite {
59
60
  if (prop === "writeFileSync") {
60
61
  return (fp, contents) => target[prop](`suite-${sNdx}/beforeAll/${fp}`, contents);
61
62
  }
62
- // if (prop === "browser") {
63
- // return new Proxy(target[prop], {
64
- // get(bTarget, bProp, bReceiver) {
65
- // if (bProp === "pages") {
66
- // return async () => {
67
- // return bTarget.pages().then((pages) => {
68
- // return pages.map((page) => {
69
- // return new Proxy(page, {
70
- // get(pTarget, pProp, pReciever) {
71
- // if (pProp === "screenshot") {
72
- // return async (x) => {
73
- // return pm.customScreenShot(
74
- // {
75
- // ...x,
76
- // path:
77
- // `${testResourceConfiguration.fs}/suite-${sNdx}/beforeAll` +
78
- // "/" +
79
- // x.path,
80
- // },
81
- // page
82
- // );
83
- // // return await window["custom-screenshot"]({
84
- // // ...x,
85
- // // path:
86
- // // `${testResourceConfiguration.fs}/suite-${sNdx}/afterAll` +
87
- // // "/" +
88
- // // x.path,
89
- // // });
90
- // };
91
- // } else if (pProp === "mainFrame") {
92
- // return () => pTarget[pProp]();
93
- // } else if (pProp === "close") {
94
- // return () => pTarget[pProp]();
95
- // }
96
- // // else if (pProp === "mainFrame") {
97
- // // return () => target[pProp](...arguments);
98
- // // }
99
- // else {
100
- // return Reflect.get(...arguments);
101
- // }
102
- // },
103
- // });
104
- // });
105
- // });
106
- // // return (await target.pages()).map((page) => {
107
- // // return new Proxy(page, handler2);
108
- // // });
109
- // };
110
- // }
111
- // },
112
- // });
113
- // }
114
63
  return Reflect.get(...arguments);
115
64
  },
116
65
  });
117
66
  const subject = await this.setup(input, suiteArtifactory, testResourceConfiguration, beforeAllProxy);
118
- const giver = this.givens[gNdx];
67
+ const giver = this.givens[gKey];
119
68
  try {
120
- this.store = await giver.give(subject, gNdx, testResourceConfiguration, this.assertThat, suiteArtifactory, tLog, pm, sNdx);
69
+ this.store = await giver.give(subject, gKey, testResourceConfiguration, this.assertThat, suiteArtifactory, tLog, pm, sNdx);
121
70
  }
122
71
  catch (e) {
123
72
  console.error(e);
@@ -125,64 +74,6 @@ class BaseSuite {
125
74
  // return this;
126
75
  }
127
76
  }
128
- // const afterAllProxy = new Proxy(pm, {
129
- // get(target, prop, receiver) {
130
- // if (prop === "writeFileSync") {
131
- // return (fp, contents) =>
132
- // target[prop](`suite-${sNdx}/afterAll/${fp}`, contents);
133
- // }
134
- // if (prop === "browser") {
135
- // return new Proxy(target[prop], {
136
- // get(bTarget, bProp, bReceiver) {
137
- // if (bProp === "pages") {
138
- // return async () => {
139
- // return bTarget.pages().then((pages) => {
140
- // return pages.map((page) => {
141
- // return new Proxy(page, {
142
- // get(pTarget, pProp, pReciever) {
143
- // if (pProp === "screenshot") {
144
- // return async (x) => {
145
- // return pm.customScreenShot({
146
- // ...x,
147
- // path:
148
- // `${testResourceConfiguration.fs}/suite-${sNdx}/afterAll` +
149
- // "/" +
150
- // x.path,
151
- // });
152
- // // return await window["custom-screenshot"]({
153
- // // ...x,
154
- // // path:
155
- // // `${testResourceConfiguration.fs}/suite-${sNdx}/afterAll` +
156
- // // "/" +
157
- // // x.path,
158
- // // });
159
- // };
160
- // } else if (pProp === "mainFrame") {
161
- // return () => pTarget[pProp]();
162
- // } else if (pProp === "close") {
163
- // return () => pTarget[pProp]();
164
- // }
165
- // // else if (pProp === "mainFrame") {
166
- // // return () => target[pProp](...arguments);
167
- // // }
168
- // else {
169
- // return Reflect.get(...arguments);
170
- // }
171
- // },
172
- // });
173
- // });
174
- // });
175
- // // return (await target.pages()).map((page) => {
176
- // // return new Proxy(page, handler2);
177
- // // });
178
- // };
179
- // }
180
- // },
181
- // });
182
- // }
183
- // return Reflect.get(...arguments);
184
- // },
185
- // });
186
77
  try {
187
78
  this.afterAll(this.store, artifactory,
188
79
  // afterAllProxy
@@ -221,7 +112,9 @@ class BaseSuite {
221
112
  }
222
113
  exports.BaseSuite = BaseSuite;
223
114
  class BaseGiven {
224
- constructor(name, features, whens, thens, givenCB, initialValues) {
115
+ constructor(name, features, whens, thens, givenCB, initialValues
116
+ // key: string
117
+ ) {
225
118
  this.name = name;
226
119
  this.features = features;
227
120
  this.whens = whens;
@@ -229,11 +122,15 @@ class BaseGiven {
229
122
  this.givenCB = givenCB;
230
123
  this.initialValues = initialValues;
231
124
  }
232
- beforeAll(store, artifactory) {
125
+ beforeAll(store,
126
+ // artifactory: ITestArtifactory
127
+ // subject,
128
+ initializer, artifactory, testResource, initialValues, pm) {
233
129
  return store;
234
130
  }
235
131
  toObj() {
236
132
  return {
133
+ key: this.key,
237
134
  name: this.name,
238
135
  whens: this.whens.map((w) => w.toObj()),
239
136
  thens: this.thens.map((t) => t.toObj()),
@@ -246,30 +143,34 @@ class BaseGiven {
246
143
  return store;
247
144
  }
248
145
  async give(subject, key, testResourceConfiguration, tester, artifactory, tLog, pm, suiteNdx) {
146
+ this.key = key;
147
+ tLog(`\n ${this.key}`);
249
148
  tLog(`\n Given: ${this.name}`);
250
- const givenArtifactory = (fPath, value) => artifactory(`given-${key}/${fPath}`, value);
149
+ const givenArtifactory = (fPath, value) => artifactory(`given-${this.key}/${fPath}`, value);
251
150
  try {
252
151
  // tLog(`\n Given this.store`, this.store);
253
152
  const beforeEachProxy = new Proxy(pm, {
254
153
  get(target, prop, receiver) {
255
154
  if (prop === "writeFileSync") {
256
- return (fp, contents) => target[prop](`suite-${suiteNdx}/given-${key}/when/beforeEach/${fp}`, contents);
155
+ return (fp, contents) => target[prop](`suite-${suiteNdx}/given-${this.key}/when/beforeEach/${fp}`, contents);
257
156
  }
258
157
  if (prop === "customScreenShot") {
259
- return (opts) => target.customScreenShot(Object.assign(Object.assign({}, opts), {
260
- // path: `${filepath}/${opts.path}`,
261
- path: `suite-${suiteNdx}/given-${key}/when/beforeEach/${opts.path}` }));
158
+ return (opts) => target.customScreenShot(Object.assign(Object.assign({}, opts), { path: `suite-${suiteNdx}/given-${this.key}/when/beforeEach/${opts.path}` }));
262
159
  }
263
160
  return Reflect.get(...arguments);
264
161
  },
265
162
  });
266
- this.store = await this.givenThat(subject, testResourceConfiguration, givenArtifactory, this.givenCB, beforeEachProxy);
267
- // console.log("mark6", this.store);
163
+ this.uberCatcher((e) => {
164
+ console.error(e);
165
+ this.error = e.error;
166
+ tLog(e.stack);
167
+ });
168
+ this.store = await this.givenThat(subject, testResourceConfiguration, givenArtifactory, this.givenCB, this.initialValues, beforeEachProxy);
268
169
  for (const [whenNdx, whenStep] of this.whens.entries()) {
269
- await whenStep.test(this.store, testResourceConfiguration, tLog, pm, `suite-${suiteNdx}/given-${key}/when/${whenNdx}`);
170
+ await whenStep.test(this.store, testResourceConfiguration, tLog, pm, `suite-${suiteNdx}/given-${this.key}/when/${whenNdx}`);
270
171
  }
271
172
  for (const [thenNdx, thenStep] of this.thens.entries()) {
272
- const t = await thenStep.test(this.store, testResourceConfiguration, tLog, pm, `suite-${suiteNdx}/given-${key}/then-${thenNdx}`);
173
+ const t = await thenStep.test(this.store, testResourceConfiguration, tLog, pm, `suite-${suiteNdx}/given-${this.key}/then-${thenNdx}`);
273
174
  tester(t);
274
175
  }
275
176
  }
@@ -285,79 +186,15 @@ class BaseGiven {
285
186
  const afterEachProxy = new Proxy(pm, {
286
187
  get(target, prop, receiver) {
287
188
  if (prop === "customScreenShot") {
288
- return (opts) => target.customScreenShot(Object.assign(Object.assign({}, opts), { path: `suite-${suiteNdx}/given-${key}/afterEach/${opts.path}` }));
189
+ return (opts) => target.customScreenShot(Object.assign(Object.assign({}, opts), { path: `suite-${suiteNdx}/given-${this.key}/afterEach/${opts.path}` }));
289
190
  }
290
191
  if (prop === "writeFileSync") {
291
- return (fp, contents) => target[prop](`suite-${suiteNdx}/given-${key}/afterEach/${fp}`, contents);
192
+ return (fp, contents) => target[prop](`suite-${suiteNdx}/given-${this.key}/afterEach/${fp}`, contents);
292
193
  }
293
- // if (prop === "browser") {
294
- // return new Proxy(target[prop], {
295
- // get(bTarget, bProp, bReceiver) {
296
- // if (bProp === "pages") {
297
- // return async () => {
298
- // return bTarget.pages().then((pages) => {
299
- // return pages.map((page) => {
300
- // return new Proxy(page, {
301
- // get(pTarget, pProp, pReciever) {
302
- // if (pProp === "screenshot") {
303
- // return async (x) => {
304
- // // console.log(
305
- // // "custom-screenshot-MARK-afterEachProxy",
306
- // // window["custom-screenshot"].toString()
307
- // // );
308
- // return pm.customScreenShot(
309
- // {
310
- // ...x,
311
- // path:
312
- // `${testResourceConfiguration.fs}/suite-${suiteNdx}/given-${key}/afterEach` +
313
- // "/" +
314
- // x.path,
315
- // },
316
- // page
317
- // );
318
- // // return await pTarget[pProp]({
319
- // // ...x,
320
- // // path:
321
- // // `${testResourceConfiguration.fs}/suite-${suiteNdx}/given-${key}/afterEach` +
322
- // // "/" +
323
- // // x.path,
324
- // // });
325
- // };
326
- // } else if (pProp === "mainFrame") {
327
- // return () => pTarget[pProp]();
328
- // // return target[pProp];
329
- // // return Reflect.get(...arguments);
330
- // } else if (pProp === "exposeFunction") {
331
- // // return Reflect.get(target, prop, receiver);
332
- // return (...a) => pTarget[pProp](...a);
333
- // // return target[pProp];
334
- // } else if (pProp === "removeExposedFunction") {
335
- // // return Reflect.get(target, prop, receiver);
336
- // return pTarget[pProp].bind(pTarget);
337
- // // return target[pProp];
338
- // }
339
- // // else if (pProp === "#frameManager") {
340
- // // return () => target[pProp](...arguments);
341
- // // }
342
- // else {
343
- // return Reflect.get(...arguments);
344
- // }
345
- // },
346
- // });
347
- // });
348
- // });
349
- // // return (await target.pages()).map((page) => {
350
- // // return new Proxy(page, handler2);
351
- // // });
352
- // };
353
- // }
354
- // },
355
- // });
356
- // }
357
194
  return Reflect.get(...arguments);
358
195
  },
359
196
  });
360
- await this.afterEach(this.store, key, givenArtifactory,
197
+ await this.afterEach(this.store, this.key, givenArtifactory,
361
198
  // pm
362
199
  afterEachProxy);
363
200
  }
@@ -515,62 +352,6 @@ class BaseThen {
515
352
  if (prop === "writeFileSync") {
516
353
  return (fp, contents) => target[prop](`${filepath}/${fp}`, contents);
517
354
  }
518
- // if (prop === "browser") {
519
- // return new Proxy(target[prop], {
520
- // get(bTarget, bProp, bReceiver) {
521
- // if (bProp === "pages") {
522
- // return async () => {
523
- // return bTarget.pages().then((pages) => {
524
- // return pages.map((page) => {
525
- // return new Proxy(page, {
526
- // get(pTarget, pProp, pReciever) {
527
- // if (pProp === "screenshot") {
528
- // return async (x) => {
529
- // return pm.customScreenShot(
530
- // {
531
- // ...x,
532
- // path:
533
- // `${testResourceConfiguration.fs}/${filepath}/butThen` +
534
- // "/" +
535
- // x.path,
536
- // },
537
- // page
538
- // );
539
- // // return await window["custom-screenshot"]({
540
- // // ...x,
541
- // // path:
542
- // // `${testResourceConfiguration.fs}/suite-${sNdx}/afterAll` +
543
- // // "/" +
544
- // // x.path,
545
- // // });
546
- // };
547
- // } else if (pProp === "close") {
548
- // return () => pTarget[pProp]();
549
- // } else if (pProp === "mainFrame") {
550
- // return () => pTarget[pProp]();
551
- // } else if (pProp === "exposeFunction") {
552
- // // return Reflect.get(target, prop, receiver);
553
- // return (...a) => pTarget[pProp](...a);
554
- // // return target[pProp];
555
- // } else if (pProp === "removeExposedFunction") {
556
- // // return Reflect.get(target, prop, receiver);
557
- // return pTarget[pProp].bind(pTarget);
558
- // // return target[pProp];
559
- // } else {
560
- // return Reflect.get(...arguments);
561
- // }
562
- // },
563
- // });
564
- // });
565
- // });
566
- // // return (await target.pages()).map((page) => {
567
- // // return new Proxy(page, handler2);
568
- // // });
569
- // };
570
- // }
571
- // },
572
- // });
573
- // }
574
355
  return Reflect.get(...arguments);
575
356
  },
576
357
  });
@@ -14,21 +14,11 @@ class BaseBuilder {
14
14
  this.checkOverides = checkOverides;
15
15
  this.testSpecification = testSpecification;
16
16
  this.specs = testSpecification(this.Suites(), this.Given(), this.When(), this.Then(), this.Check());
17
- // const f = this.specs[0].features;
18
17
  this.testJobs = this.specs.map((suite) => {
19
18
  const suiteRunner = (suite) => async (puppetMaster, tLog) => {
20
- // const puppeteerBrowser = await puppetMaster.startPuppeteer(
21
- // {
22
- // browserWSEndpoint:
23
- // puppetMaster.testResourceConfiguration.browserWSEndpoint,
24
- // },
25
- // puppetMaster.testResourceConfiguration.fs
26
- // );
27
19
  const x = await suite.run(input, puppetMaster.testResourceConfiguration, (fPath, value) => puppetMaster.testArtiFactoryfileWriter(tLog, (p) => {
28
20
  this.artifacts.push(p);
29
21
  })(puppetMaster.testResourceConfiguration.fs + "/" + fPath, value), tLog, puppetMaster);
30
- // await puppetMaster.browser.disconnect();
31
- // puppeteerBrowser.close();
32
22
  return x;
33
23
  };
34
24
  const runner = suiteRunner(suite);
@@ -62,7 +52,7 @@ class BaseBuilder {
62
52
  // );
63
53
  // }
64
54
  puppetMaster.writeFileSync(`tests.json`, JSON.stringify(this.toObj(), null, 2));
65
- console.log(`exiting gracefully with ${numberOfFailures} failures.`);
55
+ // console.log(`exiting gracefully with ${numberOfFailures} failures.`);
66
56
  return {
67
57
  failed: numberOfFailures,
68
58
  artifacts: this.artifacts || [],
@@ -10,7 +10,7 @@ class ClassBuilder extends basebuilder_js_1.BaseBuilder {
10
10
  };
11
11
  return a;
12
12
  }, {});
13
- const classyGivens = Object.entries(testImplementation.givens).reduce((a, [key, givEn]) => {
13
+ const classyGivens = Object.entries(testImplementation.givens).reduce((a, [key, g]) => {
14
14
  a[key] = (features, whens, thens, givEn) => {
15
15
  return new givenKlasser.prototype.constructor(key, features, whens, thens, testImplementation.givens[key], givEn);
16
16
  };
@@ -4,28 +4,10 @@ const index_js_1 = require("./index.js");
4
4
  const abstractBase_js_1 = require("./abstractBase.js");
5
5
  const classBuilder_js_1 = require("./classBuilder.js");
6
6
  class Testeranto extends classBuilder_js_1.ClassBuilder {
7
- constructor(input, testSpecification, testImplementation, testResourceRequirement = index_js_1.defaultTestResourceRequirement, testInterface) {
7
+ constructor(input, testSpecification, testImplementation, testResourceRequirement = index_js_1.defaultTestResourceRequirement, testInterface, uberCatcher) {
8
8
  const fullTestInterface = (0, index_js_1.DefaultTestInterface)(testInterface);
9
9
  super(testImplementation, testSpecification, input, class extends abstractBase_js_1.BaseSuite {
10
10
  afterAll(store, artifactory, pm) {
11
- // const pagesHandler = {
12
- // get(target, prop) {
13
- // console.log(`Getting pages property ${prop}`);
14
- // return target[prop];
15
- // },
16
- // };
17
- // const browserHandler = {
18
- // get(target, prop) {
19
- // console.log(`Getting browser property ${prop}`);
20
- // if (prop === "pages") {
21
- // // return target[prop];
22
- // return new Proxy(target[prop], pagesHandler);
23
- // } else {
24
- // return target[prop];
25
- // }
26
- // },
27
- // };
28
- // const proxy = new Proxy(utils.browser, browserHandler);
29
11
  return fullTestInterface.afterAll(store, (fPath, value) => {
30
12
  artifactory(`afterAll4-${this.name}/${fPath}`, value);
31
13
  }, pm);
@@ -38,10 +20,12 @@ class Testeranto extends classBuilder_js_1.ClassBuilder {
38
20
  (async (input, artifactory, tr, pm) => input))(s, this.testResourceConfiguration, artifactory, pm);
39
21
  }
40
22
  }, class Given extends abstractBase_js_1.BaseGiven {
41
- async givenThat(subject, testResource, artifactory, initializer, pm) {
42
- return fullTestInterface.beforeEach(subject, initializer, (fPath, value) =>
43
- // TODO does not work?
44
- artifactory(`beforeEach/${fPath}`, value), testResource, this.initialValues, pm);
23
+ constructor() {
24
+ super(...arguments);
25
+ this.uberCatcher = uberCatcher;
26
+ }
27
+ async givenThat(subject, testResource, artifactory, initializer, initialValues, pm) {
28
+ return fullTestInterface.beforeEach(subject, initializer, artifactory, testResource, initialValues, pm);
45
29
  }
46
30
  afterEach(store, key, artifactory, pm) {
47
31
  return new Promise((res) => res(fullTestInterface.afterEach(store, key, (fPath, value) => artifactory(`after/${fPath}`, value), pm)));
@@ -111,9 +95,7 @@ class Testeranto extends classBuilder_js_1.ClassBuilder {
111
95
  // TODO does not work?
112
96
  artifactory(`afterEach2-${this.name}/${fPath}`, value), pm)));
113
97
  }
114
- }, testResourceRequirement
115
- // puppetMaster
116
- );
98
+ }, testResourceRequirement);
117
99
  }
118
100
  }
119
101
  exports.default = Testeranto;
@@ -1,5 +1,4 @@
1
1
  "use strict";
2
- // import { ITProject } from "./src/Project.js";
3
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
3
  if (k2 === undefined) k2 = k;
5
4
  var desc = Object.getOwnPropertyDescriptor(m, k);
@@ -27,12 +26,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
27
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
28
27
  };
29
28
  Object.defineProperty(exports, "__esModule", { value: true });
30
- // import Project from "./testeranto.js";
29
+ const Puppeteer_js_1 = __importDefault(require("./Puppeteer.js"));
31
30
  const process_1 = __importDefault(require("process"));
32
- const Project_1 = require("./src/Project");
33
- // import { ITProject } from "testeranto/src/Project";
34
- // process.chdir(__dirname);
35
- // import Puppeteer from "./src/Puppeteer.js";
36
- console.log(process_1.default.argv);
37
- const Project = await Promise.resolve().then(() => __importStar(require(process_1.default.argv[2])));
38
- exports.default = new Project_1.ITProject(Project);
31
+ if (!process_1.default.argv[2]) {
32
+ console.log("You didn't pass a config file");
33
+ process_1.default.exit(-1);
34
+ }
35
+ else {
36
+ Promise.resolve().then(() => __importStar(require(process_1.default.cwd() + "/" + process_1.default.argv[2]))).then((module) => {
37
+ (0, Puppeteer_js_1.default)(module.default);
38
+ });
39
+ }