@testomatio/reporter 1.6.15 → 1.6.16-beta-2-xml-tid

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/lib/uploader.js CHANGED
@@ -262,7 +262,7 @@ class S3Uploader {
262
262
  debug('File:', filePath, 'exists, size:', prettyBytes(fileSize));
263
263
 
264
264
  const fileStream = fs.createReadStream(filePath);
265
- const Key = pathInS3.join('/');
265
+ const Key = pathInS3.filter(p => !!p).join('/');
266
266
 
267
267
  const link = await this.#uploadToS3(fileStream, Key, { path: filePath, size: fileSize });
268
268
 
@@ -279,7 +279,7 @@ class S3Uploader {
279
279
  async uploadFileAsBuffer(buffer, pathInS3) {
280
280
  if (!this.isEnabled) return;
281
281
 
282
- let Key = pathInS3.join('/');
282
+ let Key = pathInS3.filter(p => !!p).join('/');
283
283
  const ext = this.#getFileExtBase64(buffer);
284
284
 
285
285
  if (ext) {
@@ -375,7 +375,6 @@ class S3Uploader {
375
375
 
376
376
  return cfg;
377
377
  }
378
-
379
378
  }
380
379
 
381
380
  module.exports = S3Uploader;
@@ -127,12 +127,9 @@ const fetchIdFromCode = (code, opts = {}) => {
127
127
  };
128
128
 
129
129
  const fetchIdFromOutput = output => {
130
- const lines = output
131
- .split('\n')
132
- .map(l => l.trim())
133
- .filter(l => l.startsWith('tid://'));
130
+ const TID_FULL_PATTERN = new RegExp(`tid:\\/\\/.*?(${TEST_ID_REGEX.source})`);
134
131
 
135
- return lines.find(c => c.match(TEST_ID_REGEX))?.match(TEST_ID_REGEX)?.[1];
132
+ return output.match(TID_FULL_PATTERN)?.[2];
136
133
  };
137
134
 
138
135
  const fetchSourceCode = (contents, opts = {}) => {
package/lib/xmlReader.js CHANGED
@@ -421,7 +421,6 @@ class XmlReader {
421
421
  this.formatErrors();
422
422
  this.formatTests();
423
423
 
424
-
425
424
  const dataString = {
426
425
  ...this.stats,
427
426
  detach: this.requestParams.detach,
@@ -451,7 +450,11 @@ function reduceTestCases(prev, item) {
451
450
  }
452
451
 
453
452
  // suite inside test case
454
- if (item['test-suite'] && item['test-suite']['test-case']) testCases.push(...item['test-suite']['test-case']);
453
+ const testCase = item['test-suite']?.['test-case'];
454
+ if (testCase) {
455
+ const nestedCases = Array.isArray(testCase) ? testCase : [testCase];
456
+ testCases.push(...nestedCases);
457
+ }
455
458
 
456
459
  const suiteOutput = item['system-out'] || item.output || item.log || '';
457
460
  const suiteErr = item['system-err'] || item.output || item.log || '';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testomatio/reporter",
3
- "version": "1.6.15",
3
+ "version": "1.6.16-beta-2-xml-tid",
4
4
  "description": "Testomatio Reporter Client",
5
5
  "main": "./lib/reporter.js",
6
6
  "typings": "typings/index.d.ts",