(filePath)
| 44 | export function testCodeReading(projectRoot: string): (node: Node) => boolean { |
| 45 | const sources = new Map<string, string | undefined>(); |
| 46 | const readSource: SourceReader = (filePath) => { |
| 47 | if (!sources.has(filePath)) { |
| 48 | let text: string | undefined; |
| 49 | try { |
| 50 | const abs = validatePathWithinRoot(projectRoot, filePath); |
| 51 | text = abs === null ? undefined : readFileSync(abs, 'utf-8'); |
| 52 | } catch { /* unreadable → not known to be test code */ } |
| 53 | sources.set(filePath, text); |
| 54 | } |
| 55 | return sources.get(filePath); |
| 56 | }; |
| 57 | const verdicts = new Map<string, boolean>(); |
| 58 | return (node) => { |
| 59 | let v = verdicts.get(node.id); |
no test coverage detected