Function
detectConfigFile
(
targetDir: string,
framework: Framework,
)
Source from the content-addressed store, hash-verified
| 240 | } |
| 241 | |
| 242 | async function detectConfigFile( |
| 243 | targetDir: string, |
| 244 | framework: Framework, |
| 245 | ): Promise<string | undefined> { |
| 246 | if (framework === 'other') { |
| 247 | return undefined; |
| 248 | } |
| 249 | const files = await readdir(targetDir, { encoding: 'utf8' }); |
| 250 | const pattern = framework === 'vitest' ? VITEST_CONFIG : JEST_CONFIG; |
| 251 | return files.find(file => pattern.test(file)); |
| 252 | } |
| 253 | |
| 254 | function defaultTestCommand(framework: Framework): string { |
| 255 | switch (framework) { |
Tested by
no test coverage detected