Skip to content

vitest unit project excludes src/browser/**/*.test.ts entirely — 44 test files never run in CI #231

Description

@ayushsingh82

What's wrong

vitest.config.ts's unit project excludes the entire src/browser/**/*.test.ts glob:

{
  test: {
    name: 'unit',
    include: ['src/**/*.test.ts'],
    exclude: ['src/browser/**/*.test.ts'],
    sequence: { groupOrder: 0 },
  },
},

This was added in the #216 plugin-migration merge (commit 0470ac43). No other configured project picks up the slack:

  • plugin only includes plugins/*/test/**/*.test.{ts,js}
  • e2e-fixed-port / e2e only include specific named files under tests/e2e/
  • smoke only includes tests/smoke/**/*.test.ts

I checked every job in .github/workflows/*.yml that runs vitest (unit, plugin, smoke, e2e, e2e-fixed-port, plus the bun variant) — none of them cover src/browser/**.

Impact

find src/browser -name "*.test.ts" | wc -l44 test files, including verify-fixture.test.ts, cdp.test.ts, analyze.test.ts, snapshot/*.test.ts, run/*.test.ts, runtime/local-cloak/*.test.ts, etc. None of these run under npm test, npm run test:all (still project-scoped via the same config), or any CI job. Regressions in this whole subsystem currently won't be caught automatically.

Confirmed locally: running any of these files under an ad-hoc vitest config (bypassing the project filters) passes fine — so they're not failing, they're just not being invoked.

Suggested fix

Either narrow the unit project's exclude to whatever specifically motivated it during the #216 migration (if only some browser tests needed temporary exclusion), or add an explicit project/include that covers src/browser/**/*.test.ts (mirroring unit's config, or its own project if these need different setup).

Context

Found while verifying test coverage for #230 (--max-top-level-keys fix), which added tests to src/browser/verify-fixture.test.ts — those tests are correct (verified via a standalone ad-hoc vitest config) but currently don't execute in CI due to this exclusion.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions