@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.js CHANGED
@@ -18480,7 +18480,7 @@ const MESSAGES = {
18480
18480
  startingTest: (titlePath) => `Starting ${titlePath}`,
18481
18481
  },
18482
18482
  onTestEnd: {
18483
- reportedTest: (title) => `Reported ${title} to neetoPlaywrightReporter`,
18483
+ reportedTest: (title) => `Reported ${title} to neetoPlaydash`,
18484
18484
  },
18485
18485
  onEnd: {
18486
18486
  runReported: "Run completed and reported to neetoPlaydash 🎉",
@@ -18589,9 +18589,13 @@ const testEntitiesApi = { create };
18589
18589
  class MyReporter {
18590
18590
  constructor(options) {
18591
18591
  this.onBegin = async (config, rootSuite) => {
18592
+ var _a, _b;
18592
18593
  const shard = config.shard;
18594
+ this.config = config;
18595
+ this.currentShard = shard === null || shard === void 0 ? void 0 : shard.current;
18593
18596
  let attempts;
18594
18597
  this.totalTestCount = rootSuite.allTests().length;
18598
+ consoleLogFormatted.bold("Started reporting to neetoPlaydash 🎭");
18595
18599
  try {
18596
18600
  const runDetails = {
18597
18601
  commit_id: getCurrentCommitSha(),
@@ -18614,7 +18618,8 @@ class MyReporter {
18614
18618
  }));
18615
18619
  }
18616
18620
  catch (error) {
18617
- consoleLogFormatted.error(error.message);
18621
+ const data = (_a = error.response) === null || _a === void 0 ? void 0 : _a.data;
18622
+ consoleLogFormatted.error((_b = data === null || data === void 0 ? void 0 : data.error) !== null && _b !== void 0 ? _b : error.message);
18618
18623
  throw new Error(ERRORS.onBegin.failedToInitializeRun);
18619
18624
  }
18620
18625
  consoleLogFormatted.underline(MESSAGES.onBegin.testStarted);
@@ -18626,8 +18631,6 @@ class MyReporter {
18626
18631
  await sendHeartBeatSignal(this.ciBuildId);
18627
18632
  setInterval(async () => await sendHeartBeatSignal(this.ciBuildId), 60000);
18628
18633
  this.attempts = attempts;
18629
- this.config = config;
18630
- this.currentShard = shard === null || shard === void 0 ? void 0 : shard.current;
18631
18634
  };
18632
18635
  this.onTestBegin = async ({ id, title }, { retry }) => {
18633
18636
  var _a, _b;
@@ -18710,6 +18713,7 @@ class MyReporter {
18710
18713
  }
18711
18714
  };
18712
18715
  this.onEnd = async ({ status, duration }) => {
18716
+ var _a, _b;
18713
18717
  try {
18714
18718
  while (!(this.hasRunStarted &&
18715
18719
  this.totalTestCount === this.reportedTestCount &&
@@ -18725,7 +18729,8 @@ class MyReporter {
18725
18729
  });
18726
18730
  }
18727
18731
  catch (error) {
18728
- consoleLogFormatted.error(error.message);
18732
+ const data = (_a = error.response) === null || _a === void 0 ? void 0 : _a.data;
18733
+ consoleLogFormatted.error((_b = data === null || data === void 0 ? void 0 : data.error) !== null && _b !== void 0 ? _b : error.message);
18729
18734
  throw new Error(ERRORS.onEnd.failedToReportRunStatus);
18730
18735
  }
18731
18736
  finally {
@@ -18743,8 +18748,9 @@ class MyReporter {
18743
18748
  this.unreportedAttemptCount = 0;
18744
18749
  this.hasRunStarted = false;
18745
18750
  process.on("unhandledRejection", error => {
18746
- var _a;
18747
- consoleLogFormatted.error((_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : JSON.stringify(error));
18751
+ var _a, _b, _c;
18752
+ const data = (_a = error.response) === null || _a === void 0 ? void 0 : _a.data;
18753
+ 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));
18748
18754
  });
18749
18755
  }
18750
18756
  }