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.
- package/cli.js +13 -3
- 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
|
-
//
|
|
226
|
-
|
|
227
|
-
|
|
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() {
|