Skip to content

Commit feb5566

Browse files
committed
Comments for untestable codepaths
1 parent 93c4532 commit feb5566

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

files-to-prompt.ts

+5
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ interface ProcessingConfig {
1111
gitignoreRules: string[];
1212
}
1313

14+
// These two functions allow redirecting the output via mock functions, they get implicitly tested
1415
export function output(...args: any[]) {
1516
console.log(...args);
1617
}
@@ -48,6 +49,10 @@ async function processFile(filePath: string): Promise<void> {
4849
output('---');
4950
}
5051
} catch (err) {
52+
// This should not happen unless e.g. files get deleted while this tool runs
53+
// I ran into this case as the test framework was cleaning up files before this tool was done
54+
// Remove `Bun.sleep()` from the test script and you will end up here
55+
// TODO: write test case (not trivial)
5156
error(`Error processing file ${filePath}: ${err}`);
5257
}
5358
}

0 commit comments

Comments
 (0)