deflake 1.2.31 → 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 +6 -7
  2. package/package.json +1 -1
package/cli.js CHANGED
@@ -116,10 +116,8 @@ async function analyzeAndFix(artifacts, client, argv, capturedOutput = '') {
116
116
  return 0;
117
117
  }
118
118
 
119
- // Debug: verify captured output content
120
- const hasErrorContext = capturedOutput.includes('Error Context:');
121
- const errorContextCount = (capturedOutput.match(/Error Context:/g) || []).length;
122
- console.log(`${C.GRAY}📊 Captured output: ${capturedOutput.length} chars, Error Context lines: ${errorContextCount}, has 'at ': ${capturedOutput.includes(' at ')}${C.RESET}`);
119
+ // Strip ANSI escape codes from captured output — they break regex matching
120
+ const cleanOutput = capturedOutput.replace(/\x1b\[[0-9;]*m/g, '');
123
121
 
124
122
  console.log(`${C.BRIGHT}🔍 Analyzing ${artifacts.length} failure(s)...${C.RESET}\n`);
125
123
  let count = 0;
@@ -133,10 +131,11 @@ async function analyzeAndFix(artifacts, client, argv, capturedOutput = '') {
133
131
  let loc = extractLoc(content);
134
132
  let locSource = 'error-context.md';
135
133
 
136
- if (!loc && capturedOutput) {
134
+ if (!loc && cleanOutput) {
137
135
  // Extract the relevant section from captured output for this artifact
138
- const relevantOutput = extractRelevantOutput(capturedOutput, art.name);
139
- 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);
140
139
  locSource = 'console output';
141
140
  }
142
141
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deflake",
3
- "version": "1.2.31",
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": {