jest-qase-reporter 2.1.0 → 2.1.2

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.
@@ -60,6 +60,7 @@ export declare class JestQaseReporter implements Reporter {
60
60
  * @param {string} filePath
61
61
  * @param {string} fullName
62
62
  * @param {number[]} ids
63
+ * @param {Record<string, string>} parameters
63
64
  * @private
64
65
  */
65
66
  private getSignature;
package/dist/reporter.js CHANGED
@@ -111,6 +111,9 @@ class JestQaseReporter {
111
111
  if (this.metadata.attachments.length > 0) {
112
112
  result.attachments = this.metadata.attachments;
113
113
  }
114
+ // Generate signature with parameters
115
+ const ids = JestQaseReporter.getCaseId(testCaseResult.title);
116
+ result.signature = this.getSignature(test.path, testCaseResult.fullName, ids, this.metadata.parameters);
114
117
  this.cleanMetadata();
115
118
  void this.reporter.addTestResult(result);
116
119
  }
@@ -142,15 +145,13 @@ class JestQaseReporter {
142
145
  * @param {string} filePath
143
146
  * @param {string} fullName
144
147
  * @param {number[]} ids
148
+ * @param {Record<string, string>} parameters
145
149
  * @private
146
150
  */
147
- getSignature(filePath, fullName, ids) {
148
- let signature = filePath.split('/').join('::');
149
- signature += '::' + fullName.toLowerCase().replace(/\s/g, '_');
150
- if (ids.length > 0) {
151
- signature += '::' + ids.join('::');
152
- }
153
- return signature;
151
+ getSignature(filePath, fullName, ids, parameters = {}) {
152
+ const suites = filePath.split('/');
153
+ suites.push(fullName.toLowerCase().replace(/\s/g, '_'));
154
+ return (0, qase_javascript_commons_1.generateSignature)(ids, suites, parameters);
154
155
  }
155
156
  /**
156
157
  * @param {string} filePath
@@ -252,7 +253,7 @@ class JestQaseReporter {
252
253
  group_params: {},
253
254
  relations: this.getRelations(filePath, value.ancestorTitles),
254
255
  run_id: null,
255
- signature: this.getSignature(filePath, value.fullName, ids),
256
+ signature: this.getSignature(filePath, value.fullName, ids, {}),
256
257
  steps: [],
257
258
  testops_id: ids.length > 0 ? ids : null,
258
259
  id: (0, uuid_1.v4)(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jest-qase-reporter",
3
- "version": "2.1.0",
3
+ "version": "2.1.2",
4
4
  "description": "Qase TMS Jest Reporter",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -45,7 +45,7 @@
45
45
  "dependencies": {
46
46
  "lodash.get": "^4.4.2",
47
47
  "lodash.has": "^4.5.2",
48
- "qase-javascript-commons": "~2.3.0",
48
+ "qase-javascript-commons": "~2.4.1",
49
49
  "uuid": "^9.0.0"
50
50
  },
51
51
  "devDependencies": {