deflake 1.2.27 → 1.2.28

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 (2) hide show
  1. package/cli.js +13 -3
  2. package/package.json +1 -1
package/cli.js CHANGED
@@ -222,9 +222,19 @@ async function applyFix(res, loc) {
222
222
  }
223
223
 
224
224
  function extractLoc(text) {
225
- // Support .ts, .js, .cy.ts, .cy.js, .spec.ts, .spec.js
226
- const m = text.match(/at\s+(.*?\.(?:cy\.)?(?:spec\.)?(?:ts|js)):(\d+):(\d+)/);
227
- return m ? { path: path.resolve(m[1]), line: parseInt(m[2]) } : null;
225
+ // Strategy 1: Absolute path inside parentheses — at Function (/absolute/path/file.ts:75:35)
226
+ let m = text.match(/\(([^()]+\.(?:ts|js)):(\d+)(?::(\d+))?\)/);
227
+ if (m) return { path: path.resolve(m[1]), line: parseInt(m[2]) };
228
+
229
+ // Strategy 2: Absolute or relative path after "at" — at /path/file.ts:75:35 or at ../pages/file.ts:75
230
+ m = text.match(/at\s+([^\s(]+\.(?:ts|js)):(\d+)(?::(\d+))?/);
231
+ if (m) return { path: path.resolve(m[1]), line: parseInt(m[2]) };
232
+
233
+ // Strategy 3: Any path ending in .ts/.js with a line number (broadest match)
234
+ m = text.match(/([\w.\/\\-]+\.(?:ts|js)):(\d+)(?::(\d+))?/);
235
+ if (m) return { path: path.resolve(m[1]), line: parseInt(m[2]) };
236
+
237
+ return null;
228
238
  }
229
239
 
230
240
  async function runDoctor() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deflake",
3
- "version": "1.2.27",
3
+ "version": "1.2.28",
4
4
  "description": "AI-powered self-healing tool for Playwright, Cypress, and WebdriverIO tests.",
5
5
  "main": "client.js",
6
6
  "bin": {