* @template {TestConfigBase} C * @param {string} directory * @param {(directory: string, config: C) => void} runTest
(directory, runTest)
| 251 | * @param {(directory: string, config: C) => void} runTest |
| 252 | */ |
| 253 | function runTestsInDirectory(directory, runTest) { |
| 254 | const fileNames = getFileNamesAndRemoveOutput(directory); |
| 255 | if (fileNames.includes('_config.js')) { |
| 256 | loadConfigAndRunTest(directory, runTest); |
| 257 | } else if (fileNames.length === 0) { |
| 258 | console.warn(`Removing empty test directory ${directory}`); |
| 259 | rmSync(directory, { |
| 260 | force: true, |
| 261 | recursive: true |
| 262 | }); |
| 263 | } else { |
| 264 | describe(path.basename(directory), () => { |
| 265 | for (const fileName of fileNames.filter(name => name[0] !== '.').sort()) { |
| 266 | runTestsInDirectory(path.join(directory, fileName), runTest); |
| 267 | } |
| 268 | }); |
| 269 | } |
| 270 | } |
| 271 | |
| 272 | /** |
| 273 | * @param {string} directory |
no test coverage detected
searching dependent graphs…