@testomatio/reporter 1.4.5-beta.1-report-id → 1.4.5-beta.2-report-id

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.
@@ -129,8 +129,8 @@ function CodeceptReporter(config) {
129
129
  await Promise.all(reportTestPromises);
130
130
 
131
131
  if (upload.isArtifactsEnabled()) {
132
- uploadAttachments(client, videos, '🎞️ Uploading', 'video');
133
- uploadAttachments(client, traces, '📁 Uploading', 'trace');
132
+ await uploadAttachments(client, videos, '🎞️ Uploading', 'video');
133
+ await uploadAttachments(client, traces, '📁 Uploading', 'trace');
134
134
  }
135
135
 
136
136
  const status = failedTests.length === 0 ? STATUS.PASSED : STATUS.FAILED;
@@ -304,21 +304,22 @@ function CodeceptReporter(config) {
304
304
  }
305
305
 
306
306
  async function uploadAttachments(client, attachments, messagePrefix, attachmentType) {
307
- if (attachments.length > 0) {
308
- console.log(APP_PREFIX, `Attachments: ${messagePrefix} ${attachments.length} ${attachmentType}/-s ...`);
307
+ if (!attachments?.length) return;
309
308
 
310
- const promises = attachments.map(async attachment => {
311
- const { rid, title, path, type } = attachment;
312
- const file = { path, type, title };
313
- return client.addTestRun(undefined, {
314
- ...stripExampleFromTitle(title),
315
- rid,
316
- files: [file],
317
- });
309
+ console.log(APP_PREFIX, `Attachments: ${messagePrefix} ${attachments.length} ${attachmentType} ...`);
310
+
311
+ const promises = attachments.map(async attachment => {
312
+ const { rid, title, path, type } = attachment;
313
+ const file = { path, type, title };
314
+ return client.addTestRun(undefined, {
315
+ ...stripExampleFromTitle(title),
316
+ rid,
317
+ files: [file],
318
318
  });
319
+ });
320
+
321
+ await Promise.all(promises);
319
322
 
320
- await Promise.all(promises);
321
- }
322
323
  }
323
324
 
324
325
  function getTestAndMessage(title) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testomatio/reporter",
3
- "version": "1.4.5-beta.1-report-id",
3
+ "version": "1.4.5-beta.2-report-id",
4
4
  "description": "Testomatio Reporter Client",
5
5
  "main": "./lib/reporter.js",
6
6
  "typings": "typings/index.d.ts",