@testomatio/reporter 1.6.16-beta-xml → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testomatio/reporter",
3
- "version": "1.6.16-beta-xml",
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",