Skip to content

fix: skip ignored directories in test discovery#30

Merged
cnbailian merged 1 commit intomainfrom
cnbailian/debug-repterm-upgrade
Mar 6, 2026
Merged

fix: skip ignored directories in test discovery#30
cnbailian merged 1 commit intomainfrom
cnbailian/debug-repterm-upgrade

Conversation

@cnbailian
Copy link
Collaborator

Repterm's test loader was recursively scanning into node_modules and loading test files from dependencies (like bun-pty), causing fatal errors when describe() was used in contexts where it's not supported.

This fix skips common non-test directories (node_modules, .git, dist, .next, .turbo) during recursive test discovery, preventing the 'Cannot use describe outside of the test runner' error when running repterm with --record flag.

  • Added IGNORED_DIRS Set with directories that should never be traversed
  • Updated findTestFiles to skip ignored directories
  • Updated analyzeDirectory to skip ignored directories

Repterm's test loader was recursively scanning into node_modules and loading test files from dependencies (like bun-pty), causing fatal errors when describe() was used in contexts where it's not supported. This fix skips common non-test directories (node_modules, .git, dist, .next, .turbo) during recursive test discovery.

Fixes the 'Cannot use describe outside of the test runner' error when running repterm with --record flag.
@cnbailian cnbailian merged commit 080866d into main Mar 6, 2026
14 checks passed
@github-actions
Copy link

github-actions bot commented Mar 6, 2026

🎉 This PR is included in version 0.2.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant