@bigbinary/neeto-playwright-reporter 1.3.11 → 1.3.12

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
@@ -18499,7 +18499,7 @@ const MESSAGES = {
18499
18499
  startingTest: (titlePath) => `Starting ${titlePath}`,
18500
18500
  },
18501
18501
  onTestEnd: {
18502
- reportedTest: (title) => `Reported ${title} to neetoPlaywrightReporter`,
18502
+ reportedTest: (title) => `Reported ${title} to neetoPlaydash`,
18503
18503
  },
18504
18504
  onEnd: {
18505
18505
  runReported: "Run completed and reported to neetoPlaydash 🎉",
@@ -18608,9 +18608,13 @@ const testEntitiesApi = { create };
18608
18608
  class MyReporter {
18609
18609
  constructor(options) {
18610
18610
  this.onBegin = async (config, rootSuite) => {
18611
+ var _a, _b;
18611
18612
  const shard = config.shard;
18613
+ this.config = config;
18614
+ this.currentShard = shard === null || shard === void 0 ? void 0 : shard.current;
18612
18615
  let attempts;
18613
18616
  this.totalTestCount = rootSuite.allTests().length;
18617
+ consoleLogFormatted.bold("Started reporting to neetoPlaydash 🎭");
18614
18618
  try {
18615
18619
  const runDetails = {
18616
18620
  commit_id: getCurrentCommitSha(),
@@ -18633,7 +18637,8 @@ class MyReporter {
18633
18637
  }));
18634
18638
  }
18635
18639
  catch (error) {
18636
- consoleLogFormatted.error(error.message);
18640
+ const data = (_a = error.response) === null || _a === void 0 ? void 0 : _a.data;
18641
+ consoleLogFormatted.error((_b = data === null || data === void 0 ? void 0 : data.error) !== null && _b !== void 0 ? _b : error.message);
18637
18642
  throw new Error(ERRORS.onBegin.failedToInitializeRun);
18638
18643
  }
18639
18644
  consoleLogFormatted.underline(MESSAGES.onBegin.testStarted);
@@ -18645,8 +18650,6 @@ class MyReporter {
18645
18650
  await sendHeartBeatSignal(this.ciBuildId);
18646
18651
  setInterval(async () => await sendHeartBeatSignal(this.ciBuildId), 60000);
18647
18652
  this.attempts = attempts;
18648
- this.config = config;
18649
- this.currentShard = shard === null || shard === void 0 ? void 0 : shard.current;
18650
18653
  };
18651
18654
  this.onTestBegin = async ({ id, title }, { retry }) => {
18652
18655
  var _a, _b;
@@ -18729,6 +18732,7 @@ class MyReporter {
18729
18732
  }
18730
18733
  };
18731
18734
  this.onEnd = async ({ status, duration }) => {
18735
+ var _a, _b;
18732
18736
  try {
18733
18737
  while (!(this.hasRunStarted &&
18734
18738
  this.totalTestCount === this.reportedTestCount &&
@@ -18744,7 +18748,8 @@ class MyReporter {
18744
18748
  });
18745
18749
  }
18746
18750
  catch (error) {
18747
- consoleLogFormatted.error(error.message);
18751
+ const data = (_a = error.response) === null || _a === void 0 ? void 0 : _a.data;
18752
+ consoleLogFormatted.error((_b = data === null || data === void 0 ? void 0 : data.error) !== null && _b !== void 0 ? _b : error.message);
18748
18753
  throw new Error(ERRORS.onEnd.failedToReportRunStatus);
18749
18754
  }
18750
18755
  finally {
@@ -18762,8 +18767,9 @@ class MyReporter {
18762
18767
  this.unreportedAttemptCount = 0;
18763
18768
  this.hasRunStarted = false;
18764
18769
  process.on("unhandledRejection", error => {
18765
- var _a;
18766
- consoleLogFormatted.error((_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : JSON.stringify(error));
18770
+ var _a, _b, _c;
18771
+ const data = (_a = error.response) === null || _a === void 0 ? void 0 : _a.data;
18772
+ consoleLogFormatted.error((_c = (_b = data === null || data === void 0 ? void 0 : data.error) !== null && _b !== void 0 ? _b : error.message) !== null && _c !== void 0 ? _c : JSON.stringify(error));
18767
18773
  });
18768
18774
  }
18769
18775
  }