Skip to content

No test framework configured — install Vitest and React Testing Library #552

Description

@k-deejah

Problem

The project has zero test files, no test runner installed, and no test script in package.json. The .github/workflows/test.yml CI workflow file exists but there is nothing for it to run — it either always passes vacuously or always fails, giving a false signal on PRs.

Two related gaps: (1) there is no Vitest or Jest configuration, so contributors cannot write tests even if they want to; (2) there is no testing setup file or test utilities folder, meaning the first contributor to add a test would need to set up the entire infrastructure from scratch.

Solution

Install Vitest + React Testing Library and configure the project for testing:

  • Install: vitest, @vitest/ui, jsdom, @testing-library/react, @testing-library/user-event, @testing-library/jest-dom
  • Add vitest config to vite.config.ts with jsdom environment
  • Create src/test/setup.ts that extends jest-dom matchers
  • Add "test": "vitest --run" and "test:ui": "vitest --ui" to package.json scripts
  • Update .github/workflows/test.yml to run npm test

Acceptance Criteria

  • npm test runs and exits with a meaningful pass/fail result
  • Vitest and React Testing Library are in devDependencies
  • src/test/setup.ts exists and is referenced in vitest config
  • The test.yml workflow runs npm test on every PR
  • At least one placeholder test file exists to validate the setup works

Note for Contributors: If you are assigned to this issue, write a clear and detailed description for your pull request. Explain what was changed, why it was needed, how it was implemented, and include any relevant testing or screenshots where applicable.

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

    dxDeveloper experience: docs, error messages, setuptestsTest coverage, test setup, or test infrastructure

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions