deflake 1.2.30 → 1.2.32

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 +8 -3
  2. package/package.json +1 -1
package/cli.js CHANGED
@@ -115,6 +115,10 @@ async function analyzeAndFix(artifacts, client, argv, capturedOutput = '') {
115
115
  console.log(` ${C.YELLOW}⚠️ No failure artifacts detected. Run 'npx deflake doctor' to check permissions.${C.RESET}`);
116
116
  return 0;
117
117
  }
118
+
119
+ // Strip ANSI escape codes from captured output — they break regex matching
120
+ const cleanOutput = capturedOutput.replace(/\x1b\[[0-9;]*m/g, '');
121
+
118
122
  console.log(`${C.BRIGHT}🔍 Analyzing ${artifacts.length} failure(s)...${C.RESET}\n`);
119
123
  let count = 0;
120
124
  for (let i = 0; i < artifacts.length; i++) {
@@ -127,10 +131,11 @@ async function analyzeAndFix(artifacts, client, argv, capturedOutput = '') {
127
131
  let loc = extractLoc(content);
128
132
  let locSource = 'error-context.md';
129
133
 
130
- if (!loc && capturedOutput) {
134
+ if (!loc && cleanOutput) {
131
135
  // Extract the relevant section from captured output for this artifact
132
- const relevantOutput = extractRelevantOutput(capturedOutput, art.name);
133
- loc = extractLoc(relevantOutput || capturedOutput);
136
+ const relevantOutput = extractRelevantOutput(cleanOutput, art.name);
137
+ console.log(` ${C.GRAY}🔬 Relevant output: ${relevantOutput.length} chars for artifact${C.RESET}`);
138
+ loc = extractLoc(relevantOutput || cleanOutput);
134
139
  locSource = 'console output';
135
140
  }
136
141
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deflake",
3
- "version": "1.2.30",
3
+ "version": "1.2.32",
4
4
  "description": "AI-powered self-healing tool for Playwright, Cypress, and WebdriverIO tests.",
5
5
  "main": "client.js",
6
6
  "bin": {