ortoni-report 1.1.8 → 2.0.0

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/changelog.md CHANGED
@@ -1,4 +1,29 @@
1
1
  # Change Log:
2
+
3
+ ## Version 2.0.0
4
+ - Fixed local and root path issue of Parcel bundler.
5
+
6
+ ## Version 1.1.9
7
+
8
+ ### New Features
9
+
10
+ - **Configurable Report Filename**: Introduced a new configuration attribute to set the filename for the generated report. The default value is `ortoni-report.html`.
11
+ - **filename**: User can set the report file name.
12
+
13
+ ### Command-Line Interface
14
+
15
+ - **Generate Report Command**: Added a new CLI command to generate and bundle the report:
16
+ ```sh
17
+ npx ortoni-report gr
18
+ ```
19
+ This command allows users to easily generate the report with a single command.
20
+
21
+ ### Enhancements
22
+
23
+ - **Bundled Report**: The generated report is now bundled into a single file, making it easier to zip and share.
24
+ - **Storage Location**: The bundled report is stored in the `project/ortoni-report` folder for better organization and accessibility.
25
+
26
+
2
27
  ## Version 1.1.8
3
28
 
4
29
  ### Fixed
@@ -0,0 +1,44 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ var __importDefault = (this && this.__importDefault) || function (mod) {
4
+ return (mod && mod.__esModule) ? mod : { "default": mod };
5
+ };
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ const fs_1 = __importDefault(require("fs"));
8
+ const path_1 = __importDefault(require("path"));
9
+ const commander_1 = require("commander");
10
+ const child_process_1 = require("child_process");
11
+ const utils_1 = require("../utils/utils");
12
+ commander_1.program
13
+ .name('ortoni-report')
14
+ .description('Ortoni Report by LetCode with Koushik')
15
+ .version('1.0.0');
16
+ commander_1.program
17
+ .command('gr')
18
+ .description('Bundle Ortoni Report')
19
+ .option('-f, --filename <filename>', 'Specify the filename for the generated report', 'ortoni-report.html')
20
+ .action((options) => {
21
+ const filename = (0, utils_1.ensureHtmlExtension)(options.filename);
22
+ const reportPath = path_1.default.resolve(process.cwd(), filename);
23
+ if (!fs_1.default.existsSync(reportPath)) {
24
+ console.error(`${filename} not found. Please ensure the report has been generated.`);
25
+ process.exit(1);
26
+ }
27
+ // Resolve the path to the local parcel binary
28
+ const parcelPath = path_1.default.resolve(__dirname, '../../node_modules/.bin/parcel');
29
+ const parcelCommand = `${parcelPath} build ${reportPath} --dist-dir ortoni-report --public-url ./`;
30
+ console.log('Bundling Ortoni Report...');
31
+ (0, child_process_1.exec)(parcelCommand, (error, stdout, stderr) => {
32
+ if (error) {
33
+ console.error(`Error: ${error.message}`);
34
+ return;
35
+ }
36
+ if (stderr) {
37
+ console.error(`stderr: ${stderr}`);
38
+ return;
39
+ }
40
+ console.log(`stdout: ${stdout}`);
41
+ console.log('Report bundled successfully.');
42
+ });
43
+ });
44
+ commander_1.program.parse(process.argv);
@@ -38,6 +38,11 @@ interface OrtoniReportConfig {
38
38
  * @example "/absolute/path/to/logo.png"
39
39
  */
40
40
  logo?: string;
41
+ /**
42
+ * The filename to the html report.
43
+ * @example "index.html"
44
+ */
45
+ filename?: string;
41
46
  }
42
47
 
43
48
  interface Steps {
@@ -74,13 +79,15 @@ declare class OrtoniReport implements Reporter {
74
79
  private groupedResults;
75
80
  private suiteName;
76
81
  private config;
82
+ private projectSet;
83
+ private tagsSet;
77
84
  constructor(config?: OrtoniReportConfig);
78
85
  onBegin(config: FullConfig, suite: Suite): void;
79
86
  onTestBegin(test: TestCase, result: TestResult): void;
80
- private projectSet;
81
- private tagsSet;
82
87
  onTestEnd(test: TestCase, result: TestResult): void;
88
+ private attachFiles;
83
89
  onEnd(result: FullResult): void;
90
+ private groupResults;
84
91
  generateHTML(filteredResults: TestResultData[], totalDuration: string): string;
85
92
  }
86
93