qase-javascript-commons 2.0.2 → 2.0.4

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,17 @@
1
+ # qase-javascript-commons@2.0.4
2
+
3
+ ## What's new
4
+
5
+ Fixed an issue when the reporter created a test run:
6
+ `The start time does not match the format Y-m-d H:i:s.`
7
+
8
+ # qase-javascript-commons@2.0.3
9
+
10
+ ## What's new
11
+
12
+ Fixed an issue when the reporter would run tests before creating a test run.
13
+ Now the reporter will create a test run before running tests.
14
+
1
15
  # qase-javascript-commons@2.0.2
2
16
 
3
17
  ## What's new
@@ -174,6 +174,11 @@ export declare class TestOpsReporter extends AbstractReporter {
174
174
  * @private
175
175
  */
176
176
  private createRun;
177
+ /**
178
+ * @returns {string}
179
+ * @private
180
+ */
181
+ private getDate;
177
182
  /**
178
183
  * @returns {Promise<void>}
179
184
  * @private
@@ -339,6 +339,7 @@ class TestOpsReporter extends abstract_reporter_1.AbstractReporter {
339
339
  description,
340
340
  is_autotest: true,
341
341
  cases: [],
342
+ start_time: this.getDate(),
342
343
  };
343
344
  if (environment !== undefined) {
344
345
  runObject.environment_id = environment;
@@ -350,6 +351,21 @@ class TestOpsReporter extends abstract_reporter_1.AbstractReporter {
350
351
  throw new qase_error_1.QaseError('Cannot create run', { cause: error });
351
352
  }
352
353
  }
354
+ /**
355
+ * @returns {string}
356
+ * @private
357
+ */
358
+ getDate() {
359
+ const date = new Date();
360
+ date.setSeconds(-10);
361
+ const year = date.getUTCFullYear();
362
+ const month = ('0' + (date.getUTCMonth() + 1).toString()).slice(-2); // Months are zero indexed, so we add 1
363
+ const day = ('0' + date.getUTCDate().toString()).slice(-2);
364
+ const hours = ('0' + date.getUTCHours().toString()).slice(-2);
365
+ const minutes = ('0' + date.getUTCMinutes().toString()).slice(-2);
366
+ const seconds = ('0' + date.getUTCSeconds().toString()).slice(-2);
367
+ return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
368
+ }
353
369
  /**
354
370
  * @returns {Promise<void>}
355
371
  * @private
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qase-javascript-commons",
3
- "version": "2.0.2",
3
+ "version": "2.0.4",
4
4
  "description": "Qase JS Reporters",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",