deflake 1.0.5 → 1.0.6

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.
Files changed (3) hide show
  1. package/cli.js +2 -1
  2. package/client.js +4 -4
  3. package/package.json +1 -1
package/cli.js CHANGED
@@ -272,7 +272,8 @@ function extractFailureLocation(logText) {
272
272
  stepLine: null
273
273
  };
274
274
 
275
- const testMatch = logText.match(/^\s*\d+\)\s+\[.*?\]\s+›\s+(.*?.spec.ts):(\d+):\d+\s+›/m);
275
+ // Updated regex to be more flexible with arrows and spaces
276
+ const testMatch = logText.match(/^\s*\d+\)\s+\[.*?\]\s+.+?\s+(.*?.spec.ts):(\d+):(\d+)/m);
276
277
  if (testMatch) {
277
278
  loc.specFile = testMatch[1];
278
279
  loc.testLine = testMatch[2];
package/client.js CHANGED
@@ -69,10 +69,10 @@ class DeFlakeClient {
69
69
  const htmlContent = fs.readFileSync(htmlPath, 'utf8');
70
70
 
71
71
  const payload = {
72
- error_log: logContent,
73
- html_snapshot: htmlContent,
74
- failing_line: failureLocation ? `Line ${failureLocation.rootLine}` : null,
75
- source_code: sourceCode
72
+ error_log: logContent || "",
73
+ html_snapshot: htmlContent || "",
74
+ failing_line: failureLocation ? `Line ${failureLocation.rootLine}` : "",
75
+ source_code: sourceCode || ""
76
76
  };
77
77
 
78
78
  const response = await axios.post(this.apiUrl, payload, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deflake",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "AI-powered self-healing tool for Playwright, Cypress, and WebdriverIO tests.",
5
5
  "main": "client.js",
6
6
  "bin": {