transit-core-taf 1.0.13 → 1.0.15

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.
@@ -2,6 +2,8 @@ import { TestRailClientOptions } from './testrail/client';
2
2
  export interface TestRailJunitImporterOptions extends TestRailClientOptions {
3
3
  runId: number;
4
4
  junitPath: string;
5
+ onstart?: () => void;
6
+ onend?: () => void;
5
7
  }
6
8
  /**
7
9
  * Uploads a JUnit XML report to a specified TestRail test run.
@@ -46,7 +46,8 @@ const client_1 = require("./testrail/client");
46
46
  * @param options - The configuration options for the TestRail client and the JUnit import.
47
47
  */
48
48
  async function uploadJunitToTestRail(options) {
49
- const { host, user, projectId, token, password, runId, junitPath } = options;
49
+ const { host, user, projectId, token, password, runId, junitPath, onstart, onend } = options;
50
+ onstart?.();
50
51
  if (!fs.existsSync(junitPath)) {
51
52
  throw new Error(`JUnit report not found at path: ${junitPath}`);
52
53
  }
@@ -61,4 +62,7 @@ async function uploadJunitToTestRail(options) {
61
62
  console.error('Failed to upload JUnit report to TestRail.', error);
62
63
  throw error;
63
64
  }
65
+ finally {
66
+ onend?.();
67
+ }
64
68
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "transit-core-taf",
3
- "version": "1.0.13",
3
+ "version": "1.0.15",
4
4
  "description": "Transit Core Automation Framework",
5
5
  "main": "dist/transit-core-taf/index.js",
6
6
  "types": "dist/transit-core-taf/index.d.ts",