testlens-playwright-reporter 0.3.0 → 0.3.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.
package/index.js CHANGED
@@ -1,5 +1,3 @@
1
- process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';
2
-
3
1
  const { randomUUID } = require('crypto');
4
2
  const os = require('os');
5
3
  const path = require('path');
@@ -497,7 +495,11 @@ class TestLensReporter {
497
495
 
498
496
  async sendToApi(payload) {
499
497
  try {
500
- const response = await this.axiosInstance.post('', payload);
498
+ const response = await this.axiosInstance.post('', payload, {
499
+ headers: {
500
+ 'X-API-Key': this.config.apiKey
501
+ }
502
+ });
501
503
  } catch (error) {
502
504
  console.error(`❌ Failed to send ${payload.type} event to TestLens:`, {
503
505
  message: error?.message || 'Unknown error',
@@ -822,7 +824,7 @@ class TestLensReporter {
822
824
  },
823
825
  maxContentLength: Infinity,
824
826
  maxBodyLength: Infinity,
825
- timeout: Math.max(300000, Math.ceil(fileSize / (1024 * 1024)) * 5000), // 5s per MB, min 5 minutes
827
+ timeout: Math.max(600000, Math.ceil(fileSize / (1024 * 1024)) * 10000), // 10s per MB, min 10 minutes - increased for large trace files
826
828
  // Don't use custom HTTPS agent for S3 uploads
827
829
  httpsAgent: undefined
828
830
  });
package/index.ts CHANGED
@@ -1,5 +1,3 @@
1
- process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';
2
-
3
1
  import { randomUUID } from 'crypto';
4
2
  import * as os from 'os';
5
3
  import * as path from 'path';
@@ -673,7 +671,11 @@ export class TestLensReporter implements Reporter {
673
671
  private async sendToApi(payload: any): Promise<void> {
674
672
  try {
675
673
  console.log(`📤 Sending ${payload.type} event to ${this.config.apiEndpoint}`);
676
- const response = await this.axiosInstance.post('', payload);
674
+ const response = await this.axiosInstance.post('', payload, {
675
+ headers: {
676
+ 'X-API-Key': this.config.apiKey
677
+ }
678
+ });
677
679
  if (this.config.enableRealTimeStream) {
678
680
  console.log(`✅ Sent ${payload.type} event to TestLens (HTTP ${response.status})`);
679
681
  }
@@ -996,7 +998,7 @@ export class TestLensReporter implements Reporter {
996
998
  },
997
999
  maxContentLength: Infinity,
998
1000
  maxBodyLength: Infinity,
999
- timeout: Math.max(300000, Math.ceil(fileSize / (1024 * 1024)) * 5000), // 5s per MB, min 5 minutes
1001
+ timeout: Math.max(600000, Math.ceil(fileSize / (1024 * 1024)) * 10000), // 10s per MB, min 10 minutes - increased for large trace files
1000
1002
  // Don't use custom HTTPS agent for S3 uploads
1001
1003
  httpsAgent: undefined
1002
1004
  });
package/lib/index.js CHANGED
@@ -37,7 +37,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.TestLensReporter = void 0;
40
- process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';
41
40
  const crypto_1 = require("crypto");
42
41
  const os = __importStar(require("os"));
43
42
  const path = __importStar(require("path"));
@@ -493,7 +492,11 @@ class TestLensReporter {
493
492
  async sendToApi(payload) {
494
493
  try {
495
494
  console.log(`📤 Sending ${payload.type} event to ${this.config.apiEndpoint}`);
496
- const response = await this.axiosInstance.post('', payload);
495
+ const response = await this.axiosInstance.post('', payload, {
496
+ headers: {
497
+ 'X-API-Key': this.config.apiKey
498
+ }
499
+ });
497
500
  if (this.config.enableRealTimeStream) {
498
501
  console.log(`✅ Sent ${payload.type} event to TestLens (HTTP ${response.status})`);
499
502
  }
@@ -781,7 +784,7 @@ class TestLensReporter {
781
784
  },
782
785
  maxContentLength: Infinity,
783
786
  maxBodyLength: Infinity,
784
- timeout: Math.max(300000, Math.ceil(fileSize / (1024 * 1024)) * 5000), // 5s per MB, min 5 minutes
787
+ timeout: Math.max(600000, Math.ceil(fileSize / (1024 * 1024)) * 10000), // 10s per MB, min 10 minutes - increased for large trace files
785
788
  // Don't use custom HTTPS agent for S3 uploads
786
789
  httpsAgent: undefined
787
790
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "testlens-playwright-reporter",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "description": "Universal Playwright reporter for TestLens - works with both TypeScript and JavaScript projects",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",