(content: string, fn: (filePath: string) => void)
| 47 | |
| 48 | describe('test-free-shards: Windows curation', () => { |
| 49 | function withTempFile(content: string, fn: (filePath: string) => void): void { |
| 50 | const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'curation-test-')); |
| 51 | const file = path.join(dir, 'sample.test.ts'); |
| 52 | fs.writeFileSync(file, content); |
| 53 | try { |
| 54 | fn(file); |
| 55 | } finally { |
| 56 | fs.rmSync(dir, { recursive: true, force: true }); |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | test('detects /bin/bash hardcode', () => { |
| 61 | withTempFile(`spawn('/bin/bash', ['-c', 'echo hi']);`, (f) => { |
no test coverage detected