(testsDir, globalConfig)
| 49 | } |
| 50 | |
| 51 | async function loadAllTests (testsDir, globalConfig) { |
| 52 | const tests = [] |
| 53 | const resolvedDir = resolveTestsDir(testsDir) |
| 54 | if (!fs.existsSync(resolvedDir)) { |
| 55 | throw new Error(`Tests directory not found: ${resolvedDir}`) |
| 56 | } |
| 57 | const files = fs.readdirSync(resolvedDir).filter(file => file.endsWith('.js') && file !== '__init__.js') |
| 58 | |
| 59 | for (const file of files) { |
| 60 | const modulePath = path.join(resolvedDir, file) |
| 61 | |
| 62 | const module = pluginRequire(modulePath) |
| 63 | const getClientTests = module.getClientTests || (module.default && module.default.getClientTests) |
| 64 | if (typeof getClientTests === 'function') { |
| 65 | for (const testCls of getClientTests()) { |
| 66 | if (testCls.getTestTag() in globalConfig) { |
| 67 | tests.push(testCls) |
| 68 | } |
| 69 | } |
| 70 | } |
| 71 | } |
| 72 | return tests |
| 73 | } |
| 74 | |
| 75 | function getNextTest (todoTests, doneTests) { |
| 76 | for (const testCls of todoTests) { |
no test coverage detected