qase-javascript-commons 2.4.16 → 2.4.17

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,3 +1,9 @@
1
+ # qase-javascript-commons@2.4.17
2
+
3
+ ## What's new
4
+
5
+ Eliminated startup delay when reporter mode is `off`.
6
+
1
7
  # qase-javascript-commons@2.4.16
2
8
 
3
9
  ## What's new
package/dist/qase.js CHANGED
@@ -95,13 +95,16 @@ class QaseReporter {
95
95
  }
96
96
  this.logger = new logger_1.Logger(loggerOptions);
97
97
  this.logger.logDebug(`Config: ${JSON.stringify(this.sanitizeOptions(composedOptions))}`);
98
- this.hostData = (0, hostData_1.getHostInfo)(options.frameworkPackage, options.reporterName);
98
+ const effectiveMode = composedOptions.mode || options_1.ModeEnum.off;
99
+ const effectiveFallback = composedOptions.fallback || options_1.ModeEnum.off;
100
+ const needsHostData = effectiveMode === options_1.ModeEnum.testops || effectiveFallback === options_1.ModeEnum.testops;
101
+ this.hostData = needsHostData
102
+ ? (0, hostData_1.getHostInfo)(options.frameworkPackage, options.reporterName)
103
+ : (0, hostData_1.getMinimalHostData)();
99
104
  this.logger.logDebug(`Host data: ${JSON.stringify(this.hostData)}`);
100
105
  this.captureLogs = composedOptions.captureLogs;
101
106
  try {
102
- this.upstreamReporter = this.createReporter(
103
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
104
- composedOptions.mode || options_1.ModeEnum.off, composedOptions);
107
+ this.upstreamReporter = this.createReporter(effectiveMode, composedOptions);
105
108
  }
106
109
  catch (error) {
107
110
  if (error instanceof disabled_exception_1.DisabledException) {
@@ -117,9 +120,7 @@ class QaseReporter {
117
120
  }
118
121
  }
119
122
  try {
120
- this.fallbackReporter = this.createReporter(
121
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
122
- composedOptions.fallback || options_1.ModeEnum.off, composedOptions);
123
+ this.fallbackReporter = this.createReporter(effectiveFallback, composedOptions);
123
124
  }
124
125
  catch (error) {
125
126
  if (error instanceof disabled_exception_1.DisabledException) {
@@ -1,4 +1,10 @@
1
1
  import { HostData } from '../models/host-data';
2
+ /**
3
+ * Returns minimal host data without slow operations (no npm list, no execSync for node/npm).
4
+ * Use when reporter mode is "off" to avoid startup delay.
5
+ * @returns {HostData} Minimal host information object
6
+ */
7
+ export declare function getMinimalHostData(): HostData;
2
8
  /**
3
9
  * Gets information about the current host environment
4
10
  * @param {string} framework The framework name to check version for
@@ -33,6 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
33
33
  };
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.getMinimalHostData = getMinimalHostData;
36
37
  exports.getHostInfo = getHostInfo;
37
38
  const os = __importStar(require("os"));
38
39
  const cp = __importStar(require("child_process"));
@@ -158,6 +159,27 @@ function getPackageVersion(packageName) {
158
159
  return null;
159
160
  }
160
161
  }
162
+ /**
163
+ * Returns minimal host data without slow operations (no npm list, no execSync for node/npm).
164
+ * Use when reporter mode is "off" to avoid startup delay.
165
+ * @returns {HostData} Minimal host information object
166
+ */
167
+ function getMinimalHostData() {
168
+ return {
169
+ system: os.platform(),
170
+ machineName: os.hostname(),
171
+ release: os.release(),
172
+ version: '',
173
+ arch: os.arch(),
174
+ node: '',
175
+ npm: '',
176
+ framework: '',
177
+ reporter: '',
178
+ commons: '',
179
+ apiClientV1: '',
180
+ apiClientV2: '',
181
+ };
182
+ }
161
183
  /**
162
184
  * Gets information about the current host environment
163
185
  * @param {string} framework The framework name to check version for
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qase-javascript-commons",
3
- "version": "2.4.16",
3
+ "version": "2.4.17",
4
4
  "description": "Qase JS Reporters",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",