Skip to content

Create Test Environment #81

Description

@kishandev2509

Title: Enforce Automated Testing Before Commits Using Vitest and Husky

Body:
Description:
To prevent accidental breaking of existing features, we need to ensure that all tests are run before code is committed. Currently, there is no mechanism enforcing test execution before commits, which increases the risk of regressions.

Proposed Solution:

  1. Use Vitest for running all test cases (pnpm test).
  2. Use Husky to add a pre-commit hook that runs pnpm test automatically.
  3. Fail the commit if any test case fails, preventing broken code from entering the repository.

Acceptance Criteria:

  • pnpm test runs all Vitest test cases successfully.
  • Husky pre-commit hook is configured to execute pnpm test before every commit.
  • Developers cannot commit code if tests fail.

Benefits:

  • Prevents accidental breaking changes from being committed.
  • Ensures consistent code quality across contributors.
  • Encourages running and writing tests regularly.

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions