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.
- package/cli.js +2 -1
- package/client.js +4 -4
- 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
|
-
|
|
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}` :
|
|
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, {
|