@bigbinary/neeto-playwright-reporter 1.3.17 → 1.3.19

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
@@ -18646,11 +18646,11 @@ const testEntitiesApi = { create };
18646
18646
  class MyReporter {
18647
18647
  constructor(options) {
18648
18648
  this.onBegin = async (config, rootSuite) => {
18649
- var _a, _b;
18649
+ var _a, _b, _c;
18650
18650
  const shard = config.shard;
18651
18651
  this.config = config;
18652
18652
  this.currentShard = shard === null || shard === void 0 ? void 0 : shard.current;
18653
- let attempts;
18653
+ let attempts = {};
18654
18654
  this.totalTestCount = rootSuite.allTests().length;
18655
18655
  try {
18656
18656
  const runDetails = {
@@ -18674,11 +18674,12 @@ class MyReporter {
18674
18674
  }));
18675
18675
  }
18676
18676
  catch (error) {
18677
- const data = (_a = error.response) === null || _a === void 0 ? void 0 : _a.data;
18678
- consoleLogFormatted.error((_b = data === null || data === void 0 ? void 0 : data.error) !== null && _b !== void 0 ? _b : error.message);
18677
+ const axiosError = error;
18678
+ const data = (_a = axiosError.response) === null || _a === void 0 ? void 0 : _a.data;
18679
+ consoleLogFormatted.error((_b = data === null || data === void 0 ? void 0 : data.error) !== null && _b !== void 0 ? _b : axiosError.message);
18679
18680
  consoleLogFormatted.error(ERRORS.onBegin.failedToInitializeRun);
18680
18681
  process.kill(process.pid, "SIGKILL");
18681
- process.exit(1);
18682
+ ((_c = axiosError.response) === null || _c === void 0 ? void 0 : _c.status) === 422 && process.exit(1);
18682
18683
  }
18683
18684
  consoleLogFormatted.underline(MESSAGES.onBegin.testStarted);
18684
18685
  consoleLogFormatted.dim(MESSAGES.onBegin.ciBuildId(this.ciBuildId));
@@ -18687,7 +18688,7 @@ class MyReporter {
18687
18688
  consoleLogFormatted.dim(MESSAGES.onBegin.currentShard(shard.current));
18688
18689
  }
18689
18690
  await sendHeartBeatSignal(this.ciBuildId);
18690
- setInterval(async () => await sendHeartBeatSignal(this.ciBuildId), 60000);
18691
+ this.heartbeatInterval = setInterval(async () => await sendHeartBeatSignal(this.ciBuildId), 45000);
18691
18692
  this.attempts = attempts;
18692
18693
  };
18693
18694
  this.onTestBegin = async ({ id, title }, { retry }) => {
@@ -18794,6 +18795,7 @@ class MyReporter {
18794
18795
  }
18795
18796
  finally {
18796
18797
  consoleLogFormatted.invertBackground(MESSAGES.onEnd.runReported);
18798
+ clearInterval(this.heartbeatInterval);
18797
18799
  }
18798
18800
  };
18799
18801
  initializeAxios(options);
@@ -18806,6 +18808,7 @@ class MyReporter {
18806
18808
  this.unreportedAttemptCount = 0;
18807
18809
  this.hasRunStarted = false;
18808
18810
  this.testAttemptIds = [];
18811
+ this.heartbeatInterval = null;
18809
18812
  process.on("unhandledRejection", async (error) => {
18810
18813
  var _a, _b, _c;
18811
18814
  const data = (_a = error.response) === null || _a === void 0 ? void 0 : _a.data;