@bigbinary/neeto-playwright-reporter 1.3.9 → 1.3.11

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.
package/index.cjs.js CHANGED
@@ -18611,10 +18611,6 @@ class MyReporter {
18611
18611
  const shard = config.shard;
18612
18612
  let attempts;
18613
18613
  this.totalTestCount = rootSuite.allTests().length;
18614
- if (this.totalTestCount === 0) {
18615
- consoleLogFormatted.error(ERRORS.onBegin.noTestsToReport);
18616
- process.exit(0);
18617
- }
18618
18614
  try {
18619
18615
  const runDetails = {
18620
18616
  commit_id: getCurrentCommitSha(),
@@ -18627,6 +18623,11 @@ class MyReporter {
18627
18623
  shards: createShardObject({ currentShard: shard === null || shard === void 0 ? void 0 : shard.current }),
18628
18624
  };
18629
18625
  await runsApi.create(runDetails);
18626
+ this.hasRunStarted = true;
18627
+ if (this.totalTestCount === 0) {
18628
+ consoleLogFormatted.error(ERRORS.onBegin.noTestsToReport);
18629
+ return;
18630
+ }
18630
18631
  ({ data: attempts } = await testEntitiesApi.create(this.ciBuildId, {
18631
18632
  test_entities: getInitializerData(config, rootSuite),
18632
18633
  }));
@@ -18729,8 +18730,9 @@ class MyReporter {
18729
18730
  };
18730
18731
  this.onEnd = async ({ status, duration }) => {
18731
18732
  try {
18732
- while (this.totalTestCount !== this.reportedTestCount &&
18733
- this.unreportedAttemptCount !== 0)
18733
+ while (!(this.hasRunStarted &&
18734
+ this.totalTestCount === this.reportedTestCount &&
18735
+ this.unreportedAttemptCount === 0))
18734
18736
  await waitUntilTimeout(100);
18735
18737
  await Promise.allSettled(this.testResultCalls);
18736
18738
  await runsApi.update(this.ciBuildId, {
@@ -18758,6 +18760,7 @@ class MyReporter {
18758
18760
  this.totalTestCount = 0;
18759
18761
  this.reportedTestCount = 0;
18760
18762
  this.unreportedAttemptCount = 0;
18763
+ this.hasRunStarted = false;
18761
18764
  process.on("unhandledRejection", error => {
18762
18765
  var _a;
18763
18766
  consoleLogFormatted.error((_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : JSON.stringify(error));