docs
Test discovery
Refine where each framework scans for tests while preserving automatic discovery everywhere else.
Updated 2026-06-25
On this page
What this controls
Test discovery controls which repository directories the sync agent scans:
- Framework directory overrides replace automatically detected directories for one framework.
- Excluded paths prevent matching repository paths from being scanned.
Discovery decides which files enter Test Chronicle. It is separate from Testing classification, which groups files after discovery.
Automatic behaviour
The sync agent detects frameworks from configuration files, dependencies, and conventional layouts. It then applies each framework's normal test-file patterns within detected directories.
Frameworks without an override continue using automatic discovery.
When to add an override
Use a framework directory override when:
- A monorepo contains the same framework in several packages.
- Detection starts too high in the repository and scans unrelated workspaces.
- Tests live below a non-standard directory.
- A nested application has its own framework configuration.
Use excluded paths for generated, vendored, archived, or intentionally ignored directories that should never be scanned.
Configure test discovery
Open Project Settings → Test discovery.
- Choose a detected framework.
- Enter a repository-relative directory or wildcard directory pattern.
- Add additional framework rows where needed.
- Enter comma-separated excluded paths.
- Save test discovery and run another local or CI sync.
The current dashboard snapshot does not change until a sync applies the new scanning rules.
Path patterns
Discovery overrides are directory patterns, not test-file include patterns.
| Pattern | Meaning |
|---|---|
apps/store | Scan beneath one literal directory |
packages/*/src | Match one path segment between packages and src |
packages/**/tests | Match recursively until a tests directory |
* matches one path segment. ** matches recursively across path segments.
The selected framework still applies its normal spec-file patterns below the matched directories. For example, packages/* does not make every file a Vitest test.
Precedence and timing
A framework directory override is authoritative for that framework. Once a Vitest override exists, the agent scans the configured Vitest directories instead of auto-detected Vitest directories.
Excluded paths are then removed from scanning. Both changes apply on the next sync.
| Rule | Scope | Timing |
|---|---|---|
| Framework override | One framework | Next sync |
| Excluded path | All framework scans | Next sync |
| Automatic discovery | Frameworks without overrides | Every sync |
Examples
Monorepo packages
Scan Vitest projects beneath package source directories:
packages/*/src
Nested web application
Limit Playwright to one application:
apps/web/e2e
Detection is too broad
If archived fixtures are being parsed, exclude them:
archive/**, fixtures/generated/**
Reset and troubleshoot
Select Reset to automatic, save, and run another sync to remove all directory and exclusion overrides.
If a sync returns no tests:
- Confirm paths are relative to the Git repository root.
- Check that the framework selected for the override matches the files.
- Remove exclusions temporarily.
- Start with a literal directory before introducing wildcards.
- Run a local sync and inspect the resulting Tests and Files views.
SyncConfig fragment
{
"frameworkOverrides": [
{
"framework": "vitest",
"dirs": ["packages/*/src"]
},
{
"framework": "playwright",
"dirs": ["apps/web/e2e"]
}
],
"testDirExcludes": [
"archive/**",
"fixtures/generated/**"
]
}
Related reading
See it in Test Chronicle
Inspect a populated project or start tracking your own repository history.
Create a free account