newman-reporter-qase 2.3.2 → 2.3.3

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
+ # newman-reporter-qase@2.3.3
2
+
3
+ ## Fixed
4
+
5
+ - Qase test case IDs that are `<= 0` (e.g. `// qase: 0` in a Postman test script) are now dropped with a warning instead of being sent to the API, which previously rejected the whole batch with HTTP 400. Bumped `qase-javascript-commons` pin to `~2.7.4`.
6
+
1
7
  # newman-reporter-qase@2.3.2
2
8
 
3
9
  ## Fixed
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.MetadataExtractor = void 0;
4
+ const internal_1 = require("qase-javascript-commons/internal");
4
5
  // eslint-disable-next-line @typescript-eslint/no-extraneous-class
5
6
  class MetadataExtractor {
6
7
  static qaseIdRegExp = /\/\/\s*?[qQ]ase:\s?((?:[\d]+[\s,]{0,})+)/;
@@ -19,7 +20,7 @@ class MetadataExtractor {
19
20
  });
20
21
  }
21
22
  });
22
- return ids;
23
+ return (0, internal_1.filterPositiveIds)(ids);
23
24
  }
24
25
  static getProjectMapping(eventList) {
25
26
  const projectMapping = {};
@@ -31,7 +32,11 @@ class MetadataExtractor {
31
32
  while ((m = re.exec(line)) !== null) {
32
33
  const projectCode = m[1]?.trim();
33
34
  const idsStr = (m[2] ?? '').replace(/\s/g, '');
34
- const ids = idsStr.split(',').map((s) => parseInt(s, 10)).filter((n) => !Number.isNaN(n));
35
+ const rawIds = idsStr
36
+ .split(',')
37
+ .map((s) => parseInt(s, 10))
38
+ .filter((n) => !Number.isNaN(n));
39
+ const ids = (0, internal_1.filterPositiveIds)(rawIds);
35
40
  if (projectCode && projectCode.toUpperCase() !== 'ID' && ids.length > 0) {
36
41
  const existing = projectMapping[projectCode] ?? [];
37
42
  projectMapping[projectCode] = [...existing, ...ids];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "newman-reporter-qase",
3
- "version": "2.3.2",
3
+ "version": "2.3.3",
4
4
  "description": "Qase TMS Newman Reporter",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -40,7 +40,7 @@
40
40
  "author": "Qase Team <support@qase.io>",
41
41
  "license": "Apache-2.0",
42
42
  "dependencies": {
43
- "qase-javascript-commons": "~2.7.3",
43
+ "qase-javascript-commons": "~2.7.4",
44
44
  "semver": "^7.7.3"
45
45
  },
46
46
  "devDependencies": {