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.

  1. Choose a detected framework.
  2. Enter a repository-relative directory or wildcard directory pattern.
  3. Add additional framework rows where needed.
  4. Enter comma-separated excluded paths.
  5. 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.

PatternMeaning
apps/storeScan beneath one literal directory
packages/*/srcMatch one path segment between packages and src
packages/**/testsMatch 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.

RuleScopeTiming
Framework overrideOne frameworkNext sync
Excluded pathAll framework scansNext sync
Automatic discoveryFrameworks without overridesEvery 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:

  1. Confirm paths are relative to the Git repository root.
  2. Check that the framework selected for the override matches the files.
  3. Remove exclusions temporarily.
  4. Start with a literal directory before introducing wildcards.
  5. 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