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
@@ -112,12 +112,13 @@ export abstract class BaseSuite<
112
112
  const suiteArtifactory = (fPath: string, value: unknown) =>
113
113
  artifactory(`suite-${this.index}-${this.name}/${fPath}`, value);
114
114
 
115
- console.log("\nSuite:", this.index, this.name);
115
+ // console.log("\nSuite:", this.index, this.name);
116
116
  tLog("\nSuite:", this.index, this.name);
117
117
  const sNdx = this.index;
118
118
  const sName = this.name;
119
119
 
120
- for (const [gNdx, g] of Object.entries(this.givens)) {
120
+ for (const [gKey, g] of Object.entries(this.givens)) {
121
+ // console.log("gKey", gKey);
121
122
  const beforeAllProxy = new Proxy(pm, {
122
123
  get(target, prop, receiver) {
123
124
  if (prop === "customScreenShot") {
@@ -134,60 +135,6 @@ export abstract class BaseSuite<
134
135
  target[prop](`suite-${sNdx}/beforeAll/${fp}`, contents);
135
136
  }
136
137
 
137
- // if (prop === "browser") {
138
- // return new Proxy(target[prop], {
139
- // get(bTarget, bProp, bReceiver) {
140
- // if (bProp === "pages") {
141
- // return async () => {
142
- // return bTarget.pages().then((pages) => {
143
- // return pages.map((page) => {
144
- // return new Proxy(page, {
145
- // get(pTarget, pProp, pReciever) {
146
- // if (pProp === "screenshot") {
147
- // return async (x) => {
148
- // return pm.customScreenShot(
149
- // {
150
- // ...x,
151
- // path:
152
- // `${testResourceConfiguration.fs}/suite-${sNdx}/beforeAll` +
153
- // "/" +
154
- // x.path,
155
- // },
156
- // page
157
- // );
158
- // // return await window["custom-screenshot"]({
159
- // // ...x,
160
- // // path:
161
- // // `${testResourceConfiguration.fs}/suite-${sNdx}/afterAll` +
162
- // // "/" +
163
- // // x.path,
164
- // // });
165
- // };
166
- // } else if (pProp === "mainFrame") {
167
- // return () => pTarget[pProp]();
168
- // } else if (pProp === "close") {
169
- // return () => pTarget[pProp]();
170
- // }
171
-
172
- // // else if (pProp === "mainFrame") {
173
- // // return () => target[pProp](...arguments);
174
- // // }
175
- // else {
176
- // return Reflect.get(...arguments);
177
- // }
178
- // },
179
- // });
180
- // });
181
- // });
182
- // // return (await target.pages()).map((page) => {
183
- // // return new Proxy(page, handler2);
184
- // // });
185
- // };
186
- // }
187
- // },
188
- // });
189
- // }
190
-
191
138
  return Reflect.get(...arguments);
192
139
  },
193
140
  });
@@ -199,11 +146,11 @@ export abstract class BaseSuite<
199
146
  beforeAllProxy
200
147
  );
201
148
 
202
- const giver = this.givens[gNdx];
149
+ const giver = this.givens[gKey];
203
150
  try {
204
151
  this.store = await giver.give(
205
152
  subject,
206
- gNdx,
153
+ gKey,
207
154
  testResourceConfiguration,
208
155
  this.assertThat,
209
156
  suiteArtifactory,
@@ -218,68 +165,6 @@ export abstract class BaseSuite<
218
165
  }
219
166
  }
220
167
 
221
- // const afterAllProxy = new Proxy(pm, {
222
- // get(target, prop, receiver) {
223
- // if (prop === "writeFileSync") {
224
- // return (fp, contents) =>
225
- // target[prop](`suite-${sNdx}/afterAll/${fp}`, contents);
226
- // }
227
-
228
- // if (prop === "browser") {
229
- // return new Proxy(target[prop], {
230
- // get(bTarget, bProp, bReceiver) {
231
- // if (bProp === "pages") {
232
- // return async () => {
233
- // return bTarget.pages().then((pages) => {
234
- // return pages.map((page) => {
235
- // return new Proxy(page, {
236
- // get(pTarget, pProp, pReciever) {
237
- // if (pProp === "screenshot") {
238
- // return async (x) => {
239
- // return pm.customScreenShot({
240
- // ...x,
241
- // path:
242
- // `${testResourceConfiguration.fs}/suite-${sNdx}/afterAll` +
243
- // "/" +
244
- // x.path,
245
- // });
246
- // // return await window["custom-screenshot"]({
247
- // // ...x,
248
- // // path:
249
- // // `${testResourceConfiguration.fs}/suite-${sNdx}/afterAll` +
250
- // // "/" +
251
- // // x.path,
252
- // // });
253
- // };
254
- // } else if (pProp === "mainFrame") {
255
- // return () => pTarget[pProp]();
256
- // } else if (pProp === "close") {
257
- // return () => pTarget[pProp]();
258
- // }
259
-
260
- // // else if (pProp === "mainFrame") {
261
- // // return () => target[pProp](...arguments);
262
- // // }
263
- // else {
264
- // return Reflect.get(...arguments);
265
- // }
266
- // },
267
- // });
268
- // });
269
- // });
270
- // // return (await target.pages()).map((page) => {
271
- // // return new Proxy(page, handler2);
272
- // // });
273
- // };
274
- // }
275
- // },
276
- // });
277
- // }
278
-
279
- // return Reflect.get(...arguments);
280
- // },
281
- // });
282
-
283
168
  try {
284
169
  this.afterAll(
285
170
  this.store,
@@ -349,6 +234,7 @@ export abstract class BaseGiven<
349
234
  recommendedFsPath: string;
350
235
  givenCB: ITestShape["given"];
351
236
  initialValues: any;
237
+ key: string;
352
238
 
353
239
  constructor(
354
240
  name: string,
@@ -357,6 +243,7 @@ export abstract class BaseGiven<
357
243
  thens: BaseThen<ITestShape>[],
358
244
  givenCB: ITestShape["given"],
359
245
  initialValues: any
246
+ // key: string
360
247
  ) {
361
248
  this.name = name;
362
249
  this.features = features;
@@ -366,12 +253,22 @@ export abstract class BaseGiven<
366
253
  this.initialValues = initialValues;
367
254
  }
368
255
 
369
- beforeAll(store: ITestShape["istore"], artifactory: ITestArtifactory) {
256
+ beforeAll(
257
+ store: ITestShape["istore"],
258
+ // artifactory: ITestArtifactory
259
+ // subject,
260
+ initializer,
261
+ artifactory,
262
+ testResource,
263
+ initialValues,
264
+ pm
265
+ ) {
370
266
  return store;
371
267
  }
372
268
 
373
269
  toObj() {
374
270
  return {
271
+ key: this.key,
375
272
  name: this.name,
376
273
  whens: this.whens.map((w) => w.toObj()),
377
274
  thens: this.thens.map((t) => t.toObj()),
@@ -386,6 +283,7 @@ export abstract class BaseGiven<
386
283
  testResourceConfiguration,
387
284
  artifactory: ITestArtifactory,
388
285
  givenCB: ITestShape["given"],
286
+ initialValues: any,
389
287
  pm: PM
390
288
  ): Promise<ITestShape["istore"]>;
391
289
 
@@ -398,6 +296,8 @@ export abstract class BaseGiven<
398
296
  return store;
399
297
  }
400
298
 
299
+ abstract uberCatcher(e);
300
+
401
301
  async give(
402
302
  subject: ITestShape["isubject"],
403
303
  key: string,
@@ -408,10 +308,12 @@ export abstract class BaseGiven<
408
308
  pm: PM,
409
309
  suiteNdx: number
410
310
  ) {
311
+ this.key = key;
312
+ tLog(`\n ${this.key}`);
411
313
  tLog(`\n Given: ${this.name}`);
412
314
 
413
315
  const givenArtifactory = (fPath: string, value: unknown) =>
414
- artifactory(`given-${key}/${fPath}`, value);
316
+ artifactory(`given-${this.key}/${fPath}`, value);
415
317
  try {
416
318
  // tLog(`\n Given this.store`, this.store);
417
319
 
@@ -420,7 +322,7 @@ export abstract class BaseGiven<
420
322
  if (prop === "writeFileSync") {
421
323
  return (fp, contents) =>
422
324
  target[prop](
423
- `suite-${suiteNdx}/given-${key}/when/beforeEach/${fp}`,
325
+ `suite-${suiteNdx}/given-${this.key}/when/beforeEach/${fp}`,
424
326
  contents
425
327
  );
426
328
  }
@@ -429,8 +331,7 @@ export abstract class BaseGiven<
429
331
  return (opts) =>
430
332
  target.customScreenShot({
431
333
  ...opts,
432
- // path: `${filepath}/${opts.path}`,
433
- path: `suite-${suiteNdx}/given-${key}/when/beforeEach/${opts.path}`,
334
+ path: `suite-${suiteNdx}/given-${this.key}/when/beforeEach/${opts.path}`,
434
335
  });
435
336
  }
436
337
 
@@ -438,14 +339,20 @@ export abstract class BaseGiven<
438
339
  },
439
340
  });
440
341
 
342
+ this.uberCatcher((e) => {
343
+ console.error(e);
344
+ this.error = e.error;
345
+ tLog(e.stack);
346
+ });
347
+
441
348
  this.store = await this.givenThat(
442
349
  subject,
443
350
  testResourceConfiguration,
444
351
  givenArtifactory,
445
352
  this.givenCB,
353
+ this.initialValues,
446
354
  beforeEachProxy
447
355
  );
448
- // console.log("mark6", this.store);
449
356
 
450
357
  for (const [whenNdx, whenStep] of this.whens.entries()) {
451
358
  await whenStep.test(
@@ -453,7 +360,7 @@ export abstract class BaseGiven<
453
360
  testResourceConfiguration,
454
361
  tLog,
455
362
  pm,
456
- `suite-${suiteNdx}/given-${key}/when/${whenNdx}`
363
+ `suite-${suiteNdx}/given-${this.key}/when/${whenNdx}`
457
364
  );
458
365
  }
459
366
 
@@ -463,7 +370,7 @@ export abstract class BaseGiven<
463
370
  testResourceConfiguration,
464
371
  tLog,
465
372
  pm,
466
- `suite-${suiteNdx}/given-${key}/then-${thenNdx}`
373
+ `suite-${suiteNdx}/given-${this.key}/then-${thenNdx}`
467
374
  );
468
375
  tester(t);
469
376
  }
@@ -482,92 +389,25 @@ export abstract class BaseGiven<
482
389
  return (opts) =>
483
390
  target.customScreenShot({
484
391
  ...opts,
485
- path: `suite-${suiteNdx}/given-${key}/afterEach/${opts.path}`,
392
+ path: `suite-${suiteNdx}/given-${this.key}/afterEach/${opts.path}`,
486
393
  });
487
394
  }
488
395
 
489
396
  if (prop === "writeFileSync") {
490
397
  return (fp, contents) =>
491
398
  target[prop](
492
- `suite-${suiteNdx}/given-${key}/afterEach/${fp}`,
399
+ `suite-${suiteNdx}/given-${this.key}/afterEach/${fp}`,
493
400
  contents
494
401
  );
495
402
  }
496
403
 
497
- // if (prop === "browser") {
498
- // return new Proxy(target[prop], {
499
- // get(bTarget, bProp, bReceiver) {
500
- // if (bProp === "pages") {
501
- // return async () => {
502
- // return bTarget.pages().then((pages) => {
503
- // return pages.map((page) => {
504
- // return new Proxy(page, {
505
- // get(pTarget, pProp, pReciever) {
506
- // if (pProp === "screenshot") {
507
- // return async (x) => {
508
- // // console.log(
509
- // // "custom-screenshot-MARK-afterEachProxy",
510
- // // window["custom-screenshot"].toString()
511
- // // );
512
-
513
- // return pm.customScreenShot(
514
- // {
515
- // ...x,
516
- // path:
517
- // `${testResourceConfiguration.fs}/suite-${suiteNdx}/given-${key}/afterEach` +
518
- // "/" +
519
- // x.path,
520
- // },
521
- // page
522
- // );
523
-
524
- // // return await pTarget[pProp]({
525
- // // ...x,
526
- // // path:
527
- // // `${testResourceConfiguration.fs}/suite-${suiteNdx}/given-${key}/afterEach` +
528
- // // "/" +
529
- // // x.path,
530
- // // });
531
- // };
532
- // } else if (pProp === "mainFrame") {
533
- // return () => pTarget[pProp]();
534
- // // return target[pProp];
535
- // // return Reflect.get(...arguments);
536
- // } else if (pProp === "exposeFunction") {
537
- // // return Reflect.get(target, prop, receiver);
538
- // return (...a) => pTarget[pProp](...a);
539
- // // return target[pProp];
540
- // } else if (pProp === "removeExposedFunction") {
541
- // // return Reflect.get(target, prop, receiver);
542
- // return pTarget[pProp].bind(pTarget);
543
- // // return target[pProp];
544
- // }
545
- // // else if (pProp === "#frameManager") {
546
- // // return () => target[pProp](...arguments);
547
- // // }
548
- // else {
549
- // return Reflect.get(...arguments);
550
- // }
551
- // },
552
- // });
553
- // });
554
- // });
555
- // // return (await target.pages()).map((page) => {
556
- // // return new Proxy(page, handler2);
557
- // // });
558
- // };
559
- // }
560
- // },
561
- // });
562
- // }
563
-
564
404
  return Reflect.get(...arguments);
565
405
  },
566
406
  });
567
407
 
568
408
  await this.afterEach(
569
409
  this.store,
570
- key,
410
+ this.key,
571
411
  givenArtifactory,
572
412
  // pm
573
413
  afterEachProxy
@@ -809,63 +649,6 @@ export abstract class BaseThen<
809
649
  target[prop](`${filepath}/${fp}`, contents);
810
650
  }
811
651
 
812
- // if (prop === "browser") {
813
- // return new Proxy(target[prop], {
814
- // get(bTarget, bProp, bReceiver) {
815
- // if (bProp === "pages") {
816
- // return async () => {
817
- // return bTarget.pages().then((pages) => {
818
- // return pages.map((page) => {
819
- // return new Proxy(page, {
820
- // get(pTarget, pProp, pReciever) {
821
- // if (pProp === "screenshot") {
822
- // return async (x) => {
823
- // return pm.customScreenShot(
824
- // {
825
- // ...x,
826
- // path:
827
- // `${testResourceConfiguration.fs}/${filepath}/butThen` +
828
- // "/" +
829
- // x.path,
830
- // },
831
- // page
832
- // );
833
- // // return await window["custom-screenshot"]({
834
- // // ...x,
835
- // // path:
836
- // // `${testResourceConfiguration.fs}/suite-${sNdx}/afterAll` +
837
- // // "/" +
838
- // // x.path,
839
- // // });
840
- // };
841
- // } else if (pProp === "close") {
842
- // return () => pTarget[pProp]();
843
- // } else if (pProp === "mainFrame") {
844
- // return () => pTarget[pProp]();
845
- // } else if (pProp === "exposeFunction") {
846
- // // return Reflect.get(target, prop, receiver);
847
- // return (...a) => pTarget[pProp](...a);
848
- // // return target[pProp];
849
- // } else if (pProp === "removeExposedFunction") {
850
- // // return Reflect.get(target, prop, receiver);
851
- // return pTarget[pProp].bind(pTarget);
852
- // // return target[pProp];
853
- // } else {
854
- // return Reflect.get(...arguments);
855
- // }
856
- // },
857
- // });
858
- // });
859
- // });
860
- // // return (await target.pages()).map((page) => {
861
- // // return new Proxy(page, handler2);
862
- // // });
863
- // };
864
- // }
865
- // },
866
- // });
867
- // }
868
-
869
652
  return Reflect.get(...arguments);
870
653
  },
871
654
  });
@@ -82,7 +82,6 @@ export abstract class BaseBuilder<
82
82
  this.Check()
83
83
  );
84
84
 
85
- // const f = this.specs[0].features;
86
85
  this.testJobs = this.specs.map((suite: BaseSuite<ITestShape>) => {
87
86
  const suiteRunner =
88
87
  (suite: BaseSuite<ITestShape>) =>
@@ -90,14 +89,6 @@ export abstract class BaseBuilder<
90
89
  puppetMaster: PM,
91
90
  tLog: ITLog
92
91
  ): Promise<BaseSuite<ITestShape>> => {
93
- // const puppeteerBrowser = await puppetMaster.startPuppeteer(
94
- // {
95
- // browserWSEndpoint:
96
- // puppetMaster.testResourceConfiguration.browserWSEndpoint,
97
- // },
98
- // puppetMaster.testResourceConfiguration.fs
99
- // );
100
-
101
92
  const x = await suite.run(
102
93
  input,
103
94
  puppetMaster.testResourceConfiguration,
@@ -112,8 +103,6 @@ export abstract class BaseBuilder<
112
103
  puppetMaster
113
104
  );
114
105
 
115
- // await puppetMaster.browser.disconnect();
116
- // puppeteerBrowser.close();
117
106
  return x;
118
107
  };
119
108
 
@@ -163,7 +152,7 @@ export abstract class BaseBuilder<
163
152
  `tests.json`,
164
153
  JSON.stringify(this.toObj(), null, 2)
165
154
  );
166
- console.log(`exiting gracefully with ${numberOfFailures} failures.`);
155
+ // console.log(`exiting gracefully with ${numberOfFailures} failures.`);
167
156
 
168
157
  return {
169
158
  failed: numberOfFailures,
@@ -57,8 +57,9 @@ export abstract class ClassBuilder<
57
57
  },
58
58
  {}
59
59
  );
60
+
60
61
  const classyGivens = Object.entries(testImplementation.givens).reduce(
61
- (a, [key, givEn]) => {
62
+ (a, [key, g]) => {
62
63
  a[key] = (features, whens, thens, givEn) => {
63
64
  return new givenKlasser.prototype.constructor(
64
65
  key,
package/src/lib/core.ts CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  ITestImplementation,
6
6
  } from "../Types.js";
7
7
 
8
- import { ITestInterface } from "./types.js";
8
+ import { IFinalResults, ITestInterface } from "./types.js";
9
9
  import {
10
10
  DefaultTestInterface,
11
11
  ITTestResourceRequest,
@@ -43,9 +43,11 @@ export default abstract class Testeranto<
43
43
  testSpecification: ITestSpecification<ITestShape>,
44
44
  testImplementation: ITestImplementation<ITestShape>,
45
45
  testResourceRequirement: ITTestResourceRequest = defaultTestResourceRequirement,
46
- testInterface: Partial<ITestInterface<ITestShape>>
46
+ testInterface: Partial<ITestInterface<ITestShape>>,
47
+ uberCatcher: (cb) => void
47
48
  ) {
48
49
  const fullTestInterface = DefaultTestInterface(testInterface);
50
+
49
51
  super(
50
52
  testImplementation,
51
53
  testSpecification,
@@ -53,26 +55,6 @@ export default abstract class Testeranto<
53
55
 
54
56
  class extends BaseSuite<ITestShape> {
55
57
  afterAll(store: IStore, artifactory: ITestArtifactory, pm: PM) {
56
- // const pagesHandler = {
57
- // get(target, prop) {
58
- // console.log(`Getting pages property ${prop}`);
59
- // return target[prop];
60
- // },
61
- // };
62
-
63
- // const browserHandler = {
64
- // get(target, prop) {
65
- // console.log(`Getting browser property ${prop}`);
66
- // if (prop === "pages") {
67
- // // return target[prop];
68
- // return new Proxy(target[prop], pagesHandler);
69
- // } else {
70
- // return target[prop];
71
- // }
72
- // },
73
- // };
74
- // const proxy = new Proxy(utils.browser, browserHandler);
75
-
76
58
  return fullTestInterface.afterAll(
77
59
  store,
78
60
  (fPath: string, value: unknown) =>
@@ -107,15 +89,22 @@ export default abstract class Testeranto<
107
89
  } as any,
108
90
 
109
91
  class Given extends BaseGiven<ITestShape> {
110
- async givenThat(subject, testResource, artifactory, initializer, pm) {
92
+ uberCatcher = uberCatcher;
93
+
94
+ async givenThat(
95
+ subject,
96
+ testResource,
97
+ artifactory,
98
+ initializer,
99
+ initialValues,
100
+ pm
101
+ ) {
111
102
  return fullTestInterface.beforeEach(
112
103
  subject,
113
104
  initializer,
114
- (fPath: string, value: unknown) =>
115
- // TODO does not work?
116
- artifactory(`beforeEach/${fPath}`, value),
105
+ artifactory,
117
106
  testResource,
118
- this.initialValues,
107
+ initialValues,
119
108
  pm
120
109
  );
121
110
  }
@@ -258,11 +247,10 @@ export default abstract class Testeranto<
258
247
  } as any,
259
248
 
260
249
  testResourceRequirement
261
- // puppetMaster
262
250
  );
263
251
  }
264
252
 
265
253
  abstract receiveTestResourceConfig(
266
254
  partialTestResource: string
267
- ): Promise<string[]>;
255
+ ): Promise<IFinalResults>;
268
256
  }
package/src/lib/types.ts CHANGED
@@ -12,6 +12,8 @@ import {
12
12
  import { ITTestResourceConfiguration, ITestArtificer } from ".";
13
13
  import { PM } from "../PM/index";
14
14
 
15
+ export type IFinalResults = { features: string[]; failed: number };
16
+
15
17
  export type IRunTime = `node` | `web`;
16
18
 
17
19
  export type ITestTypes = [string, IRunTime, { ports: number }, ITestTypes[]];
@@ -213,7 +215,7 @@ export type ITestInterface<
213
215
  beforeEach: (
214
216
  subject: ITestShape["isubject"],
215
217
  initializer: (c?) => ITestShape["given"],
216
- // artificer: ITestArtificer,
218
+ artificer: ITestArtificer,
217
219
  testResource: ITTestResourceConfiguration,
218
220
  initialValues,
219
221
  pm: PM
@@ -0,0 +1,12 @@
1
+ import Puppeteer from "./Puppeteer.js";
2
+
3
+ import process from "process";
4
+
5
+ if (!process.argv[2]) {
6
+ console.log("You didn't pass a config file");
7
+ process.exit(-1);
8
+ } else {
9
+ import(process.cwd() + "/" + process.argv[2]).then((module) => {
10
+ Puppeteer(module.default);
11
+ });
12
+ }
package/tsconfig.json CHANGED
@@ -43,7 +43,7 @@
43
43
  "./**/*.*ts",
44
44
  "./**/*.*tsx",
45
45
  "index.d.ts",
46
- "build-tests.ts",
46
+ "src/build-tests.ts",
47
47
  "run-tests.ts",
48
48
  "testeranto.ts",
49
49
  ],
package/build-tests.ts DELETED
@@ -1,16 +0,0 @@
1
- // import { ITProject } from "./src/Project.js";
2
-
3
- // import Project from "./testeranto.js";
4
-
5
- import process from "process";
6
- import { ITProject } from "./src/Project";
7
- // import { ITProject } from "testeranto/src/Project";
8
-
9
- // process.chdir(__dirname);
10
-
11
- // import Puppeteer from "./src/Puppeteer.js";
12
-
13
- console.log(process.argv);
14
- const Project = await import(process.argv[2]);
15
-
16
- export default new ITProject(Project as any);
@@ -1,8 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const Init_js_1 = __importDefault(require("./src/Init.js"));
7
- const testeranto_js_1 = __importDefault(require("./testeranto.js"));
8
- exports.default = (0, Init_js_1.default)(testeranto_js_1.default);
@@ -1,10 +0,0 @@
1
- // import { ITProject } from "./src/Project.js";
2
- // import Project from "./testeranto.js";
3
- import process from "process";
4
- import { ITProject } from "./src/Project";
5
- // import { ITProject } from "testeranto/src/Project";
6
- // process.chdir(__dirname);
7
- // import Puppeteer from "./src/Puppeteer.js";
8
- console.log(process.argv);
9
- const Project = await import(process.argv[2]);
10
- export default new ITProject(Project);
@@ -1,3 +0,0 @@
1
- import Init from "./src/Init.js";
2
- import Project from "./testeranto.js";
3
- export default Init(Project);
@@ -1,6 +0,0 @@
1
- import process from "process";
2
- process.chdir(__dirname);
3
- import Puppeteer from "./src/Puppeteer.js";
4
- console.log(process.argv);
5
- const Project = await import(process.argv[2]);
6
- export default Puppeteer(Project);