Skip to content

test: propose test isolation improvements (clearMocks/restoreMocks) and coverage reporting #338158

Closed as not planned

Description

Hello! 👋 While working with the test suite in this repository, I noticed we could further improve test reliability and maintainability.

I propose adding the following configuration options to vitest.config.ts:

  1. Test Isolation (clearMocks & restoreMocks): Automatically resetting and restoring mocks between test runs to prevent potential side-effects and flaky test behaviors.
  2. Code Coverage Support: Adding a baseline v8 coverage configuration to make tracking test coverage metrics easier for contributors.

Activity

  1. added
    stale
    on Oct 4, 2026
  2. dmitrivMS commented on Nov 15, 2026

    @dmitrivMS
    Collaborator

    Your PR added clearMocks/restoreMocks. I don't think we have an immediate need to enable code coverage globally though.

  3. removed
    stale
    on Nov 15, 2026
  4. denizguney commented on Nov 15, 2026

    @denizguney
    ContributorAuthor

    Thanks for the feedback! Should I remove the global code coverage configuration and update the PR to keep only clearMocks/restoreMocks?

  5. dmitrivMS commented on Nov 15, 2026

    @dmitrivMS
    Collaborator

    Deniz Güney Yıldırım (@denizguney) The PR is already merged...

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

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions