MCPcopy Create free account
hub / github.com/codemix/graph / applyUnskips

Function applyUnskips

packages/graph/scripts/tck-audit.ts:213–239  ·  view source on GitHub ↗

* Apply changes to unskip passing tests

(results: TestResult[])

Source from the content-addressed store, hash-verified

211 * Apply changes to unskip passing tests
212 */
213function applyUnskips(results: TestResult[]): void {
214 const passing = results.filter((r) => r.passed);
215
216 // Group by file
217 const byFile = new Map<string, TestResult[]>();
218 for (const result of passing) {
219 const existing = byFile.get(result.test.file) || [];
220 existing.push(result);
221 byFile.set(result.test.file, existing);
222 }
223
224 for (const [file, tests] of byFile) {
225 let content = fs.readFileSync(file, "utf-8");
226
227 // Sort by line number descending so replacements don't shift line numbers
228 tests.sort((a, b) => b.test.lineNumber - a.test.lineNumber);
229
230 const lines = content.split("\n");
231 for (const test of tests) {
232 const lineIndex = test.test.lineNumber - 1;
233 lines[lineIndex] = lines[lineIndex].replace("test.skip", "test");
234 }
235
236 fs.writeFileSync(file, lines.join("\n"));
237 console.log(`Updated ${file}: unskipped ${tests.length} tests`);
238 }
239}
240
241/**
242 * Generate markdown report

Callers 1

mainFunction · 0.85

Calls 3

filterMethod · 0.80
getMethod · 0.65
pushMethod · 0.45

Tested by

no test coverage detected