ortoni-report 4.0.2-beta.1 → 4.1.0-test.1

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.
@@ -8,9 +8,9 @@ import {
8
8
  extractSuites,
9
9
  normalizeFilePath,
10
10
  startReportServer
11
- } from "./chunk-JEIWNUQY.mjs";
11
+ } from "./chunk-4RZ5C7KY.mjs";
12
12
 
13
- // src/helpers/resultProcessor .ts
13
+ // src/helpers/resultProcessor.ts
14
14
  import AnsiToHtml from "ansi-to-html";
15
15
  import path2 from "path";
16
16
 
@@ -1272,7 +1272,7 @@ function getFileExtension(contentType) {
1272
1272
  return extensions[contentType] || "unknown";
1273
1273
  }
1274
1274
 
1275
- // src/helpers/resultProcessor .ts
1275
+ // src/helpers/resultProcessor.ts
1276
1276
  var TestResultProcessor = class {
1277
1277
  constructor(projectRoot) {
1278
1278
  this.ansiToHtml = new AnsiToHtml({ fg: "var(--snippet-color)" });
@@ -1391,7 +1391,7 @@ var OrtoniReport = class {
1391
1391
  await this.dbManager.initialize(
1392
1392
  path3.join(this.folderPath, "ortoni-data-history.sqlite")
1393
1393
  );
1394
- this.config = config?.shard;
1394
+ this.shardConfig = config?.shard;
1395
1395
  }
1396
1396
  onStdOut(chunk, _test, _result) {
1397
1397
  if (this.reportsCount == 1 && this.showConsoleLogs) {
@@ -1408,7 +1408,7 @@ var OrtoniReport = class {
1408
1408
  );
1409
1409
  this.results.push(testResult);
1410
1410
  } catch (error) {
1411
- console.error("OrtoniReport: Error processing test end:", error);
1411
+ console.error("Ortoni Report: Error processing test end:", error);
1412
1412
  }
1413
1413
  }
1414
1414
  printsToStdio() {
@@ -1427,8 +1427,8 @@ var OrtoniReport = class {
1427
1427
  (r) => r.status !== "skipped"
1428
1428
  );
1429
1429
  const totalDuration = result.duration;
1430
- if (this.config && this.config.total > 1) {
1431
- const shard = this.config;
1430
+ if (this.shardConfig && this.shardConfig.total > 1) {
1431
+ const shard = this.shardConfig;
1432
1432
  const shardFile = `ortoni-shard-${shard.current}-of-${shard.total}.json`;
1433
1433
  const shardData = {
1434
1434
  status: result.status,
@@ -1445,8 +1445,11 @@ var OrtoniReport = class {
1445
1445
  meta: this.ortoniConfig.meta
1446
1446
  }
1447
1447
  };
1448
- this.fileManager.writeRawFile(shardFile, shardData);
1449
- console.log(`\u{1F4E6} OrtoniReport wrote shard file: ${shardFile}`);
1448
+ const shardFilePath = this.fileManager.writeRawFile(
1449
+ shardFile,
1450
+ shardData
1451
+ );
1452
+ console.info(`Ortoni Report: Shard data written to ${shardFilePath}`);
1450
1453
  this.shouldGenerateReport = false;
1451
1454
  return;
1452
1455
  }
@@ -1459,21 +1462,21 @@ var OrtoniReport = class {
1459
1462
  this.results,
1460
1463
  this.projectSet
1461
1464
  );
1462
- this.outputPath = this.fileManager.writeReportFile(
1465
+ this.outputPath = await this.fileManager.writeReportFile(
1463
1466
  this.outputFilename,
1464
1467
  finalReportData
1465
1468
  );
1466
1469
  } else {
1467
- console.error("OrtoniReport: Error saving test run to database");
1470
+ console.error("Ortoni Report: Error saving test run to database");
1468
1471
  }
1469
1472
  } else {
1470
1473
  console.error(
1471
- "OrtoniReport: Report generation skipped due to error in Playwright worker!"
1474
+ "Ortoni Report: Report generation skipped due to error in Playwright worker!"
1472
1475
  );
1473
1476
  }
1474
1477
  } catch (error) {
1475
1478
  this.shouldGenerateReport = false;
1476
- console.error("OrtoniReport: Error generating report:", error);
1479
+ console.error("Ortoni Report: Error generating report:", error);
1477
1480
  }
1478
1481
  }
1479
1482
  async onExit() {
@@ -1481,7 +1484,7 @@ var OrtoniReport = class {
1481
1484
  await this.dbManager.close();
1482
1485
  if (this.shouldGenerateReport) {
1483
1486
  this.fileManager.copyTraceViewerAssets(this.skipTraceViewer);
1484
- console.info(`Ortoni HTML report generated at ${this.outputPath}`);
1487
+ console.info(`Ortoni Report generated at ${this.outputPath}`);
1485
1488
  this.serverManager.startServer(
1486
1489
  this.folderPath,
1487
1490
  this.outputFilename,
@@ -1491,7 +1494,7 @@ var OrtoniReport = class {
1491
1494
  });
1492
1495
  }
1493
1496
  } catch (error) {
1494
- console.error("OrtoniReport: Error in onExit:", error);
1497
+ console.error("Ortoni Report: Error in onExit:", error);
1495
1498
  }
1496
1499
  }
1497
1500
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ortoni-report",
3
- "version": "4.0.2-beta.1",
3
+ "version": "4.1.0-test.1",
4
4
  "description": "Playwright Report By LetCode with Koushik",
5
5
  "scripts": {
6
6
  "tsc": "tsc",
@@ -8,10 +8,11 @@
8
8
  "release": "npm publish"
9
9
  },
10
10
  "bin": {
11
- "ortoni-report": "./dist/cli/cli.js"
11
+ "ortoni-report": "./dist/cli.js"
12
12
  },
13
13
  "files": [
14
- "dist",
14
+ "dist/",
15
+ "dist/index.html",
15
16
  "README.md",
16
17
  "CHANGELOG.md"
17
18
  ],
@@ -52,5 +53,11 @@
52
53
  },
53
54
  "main": "dist/ortoni-report.js",
54
55
  "module": "dist/ortoni-report.mjs",
55
- "types": "dist/ortoni-report.d.ts"
56
+ "types": "dist/ortoni-report.d.ts",
57
+ "exports": {
58
+ ".": {
59
+ "require": "./dist/ortoni-report.js",
60
+ "import": "./dist/ortoni-report.mjs"
61
+ }
62
+ }
56
63
  }