Skip to content

Commit b663e47

Browse files
cosmithclaude
andcommitted
fix: don't fail convert when input file doesn't exist
When tests are skipped or fail early, the JUnit XML file won't exist. The convert command should handle this gracefully instead of failing. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 711cd12 commit b663e47

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/commands/convert.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,15 @@ export async function convert({
77
from: string;
88
to: string;
99
}) {
10-
// read junit xml file
10+
// check if input file exists
1111
const junitXmlFile = Bun.file(from);
12+
if (!(await junitXmlFile.exists())) {
13+
console.warn(`Input file not found: ${from}`);
14+
console.warn(`Skipping convert (this is normal if tests were skipped or failed early)`);
15+
return;
16+
}
17+
18+
// read junit xml file
1219
const xmlString = await junitXmlFile.text();
1320

1421
// parse junit xml

0 commit comments

Comments
 (0)