Skip to content

[ENHANCEMENT] Add dist-scoped Vitest config and Turbo task for bundle-coupled tests #116

Description

@edelauna

Problem (one or two sentences)

The 13 root-level integration tests in src/__tests__/ (including dist_assets.spec.ts, extension wiring specs, and delegation flow specs) all require dist/ to be present and cannot be safely grouped with area-unit tests that have no bundle dependency.

Context (who is affected and when)

dist_assets.spec.ts directly validates dist/ file presence (WASM files, tree-sitter grammars, marketplace assets). The other specs in src/__tests__/ exercise extension and delegation behaviors that also depend on built artifacts. Grouping them with pure unit tests would either silently skip bundle-dependent assertions or force every area slice to depend on bundle. This is part of the coverage-slicing work tracked in #47 and depends on #114.

Desired behavior (conceptual, not technical)

A dedicated vitest.dist.config.ts covers src/__tests__/**. A corresponding test:coverage:dist Turbo task with dependsOn: ["bundle"] ensures the bundle is present before these tests run. Coverage output goes to coverage/dist/.

Constraints / preferences (optional)

  • dependsOn in src/turbo.json for this task should only list bundle@roo-code/types#build is inherited from root turbo.json.
  • src/__tests__/ should remain the home for integration/dist tests only; pure unit tests belong in area subdirectories.

Request checklist

  • I've searched existing Issues and Discussions for duplicates
  • This describes a specific problem with clear context and impact

Acceptance criteria (optional)

  • vitest run --config vitest.dist.config.ts --coverage passes with dist/ present and fails cleanly without it.
  • turbo run test:coverage:dist --filter=zoo-code --dry-run shows bundle in the dependency graph.
  • Coverage output appears at coverage/dist/lcov.info.

Proposed approach (optional)

  1. Create src/vitest.dist.config.ts scoping include to src/__tests__/** and coverage.reportsDirectory to coverage/dist/.
  2. Add test:coverage:dist to src/turbo.json with dependsOn: ["bundle"] and outputs: ["coverage/dist/**"].

Trade-offs / risks (optional)

If future tests are added to src/__tests__/ that are not dist-coupled, they will unnecessarily depend on bundle. Keep src/__tests__/ for integration/dist tests only.


Parent issue: #47
Depends on: #114

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions