diff --git a/bun.lock b/bun.lock index 94af960..aab054c 100644 --- a/bun.lock +++ b/bun.lock @@ -45,14 +45,14 @@ }, "packages/plugin-api": { "name": "repterm-api", - "version": "0.1.3", + "version": "0.1.4", "devDependencies": { "typescript": "^5.3.0", }, }, "packages/plugin-kubectl": { "name": "@nexusgpu/repterm-plugin-kubectl", - "version": "0.1.3", + "version": "0.1.4", "dependencies": { "repterm-api": "workspace:*", }, diff --git a/packages/repterm/src/runner/loader.ts b/packages/repterm/src/runner/loader.ts index facadb5..33751cd 100644 --- a/packages/repterm/src/runner/loader.ts +++ b/packages/repterm/src/runner/loader.ts @@ -88,6 +88,9 @@ export async function discoverTests( return testFiles; } +/** Directories that should never be traversed when discovering tests. */ +const IGNORED_DIRS = new Set(['node_modules', '.git', 'dist', '.next', '.turbo']); + /** * Recursively find test files matching pattern */ @@ -106,6 +109,7 @@ async function findTestFiles( const stats = await stat(fullPath); if (stats.isDirectory() && recursive) { + if (IGNORED_DIRS.has(entry)) continue; const nestedFiles = await findTestFiles(fullPath, pattern, recursive); files.push(...nestedFiles); } else if (stats.isFile() && pattern.test(entry)) { @@ -197,7 +201,9 @@ async function analyzeDirectory( const stats = await stat(fullPath); if (stats.isDirectory()) { - subdirs.push(fullPath); + if (!IGNORED_DIRS.has(entry)) { + subdirs.push(fullPath); + } } else if (stats.isFile() && pattern.test(entry)) { if (isSetupFile(entry)) { setupFile = fullPath;