MCPcopy
hub / github.com/docmirror/dev-sidecar / loadAllTests

Function loadAllTests

packages/core/src/modules/plugin/free-eye/client.js:51–73  ·  view source on GitHub ↗
(testsDir, globalConfig)

Source from the content-addressed store, hash-verified

49}
50
51async 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
75function getNextTest (todoTests, doneTests) {
76 for (const testCls of todoTests) {

Callers 1

runTestsFunction · 0.85

Calls 3

resolveTestsDirFunction · 0.85
getClientTestsFunction · 0.70
getTestTagMethod · 0.45

Tested by

no test coverage detected