Skip to content

Remove the duplicate and conflicting Vitest configuration #16

Description

@priscaenoch

Problem

There are now two competing Vitest configurations and two setup files in the repository:

  • vite.config.ts declares test: { environment: "jsdom", globals: true, setupFiles: ["./test/setup.ts"] }
  • vitest.config.ts declares its own test block with setupFiles: './vitest.setup.ts', coverage settings, and an @ path alias
  • Both test/setup.ts and vitest.setup.ts exist

Vitest gives vitest.config.ts precedence over the test block in vite.config.ts, so the vite.config.ts test settings and test/setup.ts are silently ignored. Two sources of truth mean a contributor editing the wrong one sees no effect, and the @ alias and coverage settings only apply in one of them.

What needs to be done

  • Choose one configuration file as authoritative (recommended: vitest.config.ts, since it already has coverage and the alias).
  • Remove the test block from vite.config.ts, or delete vitest.config.ts and merge its settings into vite.config.ts.
  • Delete the redundant setup file so only one remains, and ensure the surviving config points at it.
  • Confirm the @ alias resolves in tests and in the app build consistently (if the alias is kept, it must also exist in vite.config.ts and tsconfig.json).

Files

  • vite.config.ts
  • vitest.config.ts
  • test/setup.ts
  • vitest.setup.ts

Acceptance deliverables

  • Exactly one Vitest config and one setup file remain.
  • Editing the surviving setup file demonstrably affects test runs.

Tests to pass

  • npm test passes with the single configuration.
  • A test asserting a jest-dom matcher passes, proving the setup file is loaded.

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial Campaign | FWC26Campaign: Official Campaign | FWC26bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions