Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion packages/repterm/src/runner/loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand All @@ -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)) {
Expand Down Expand Up @@ -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;
Expand Down