Skip to content

test: add mock reset configuration and test coverage support - #338159

Merged
Dmitriy Vasyura (dmitrivMS) merged 3 commits into
microsoft:mainfrom
denizguney:patch-41
Oct 31, 2026
Merged

Dmitriy Vasyura (dmitrivMS) merged 3 commits into
microsoft:mainfrom
denizguney:patch-41

Conversation

@denizguney

Copy link
Copy Markdown
Contributor
  • Follows up on the test improvements proposal.

Relates to #338158

- Added `clearMocks` and `restoreMocks` to ensure strict test isolation and reduce flaky behavior across test runs.
- Configured baseline `v8` coverage reporting to assist contributors in tracking test coverage metrics.
- Follows up on the test improvements proposal.
Copilot AI balanced review requested due to automatic review settings September 26, 2026 23:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

The V8 coverage provider is configured but not declared as a chat-lib dependency.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

Adds Vitest test isolation and baseline coverage configuration for the standalone chat library.

Changes:

  • Clears and restores mocks between tests.
  • Configures V8 coverage with text, JSON, and HTML reports.
File Description
extensions/​copilot/​chat-lib/​vitest.config.ts Adds mock cleanup and coverage settings.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

…iew warning

- Removed the `coverage` block from vitest config to prevent missing `@vitest/coverage-v8` dependency issues in the standalone chat-lib package.
- Retained strict test isolation settings (`clearMocks` and `restoreMocks`).
@dmitrivMS
Dmitriy Vasyura (dmitrivMS) merged commit c183be8 into microsoft:main Oct 31, 2026
55 checks passed
@vs-code-engineering vs-code-engineering Bot added this to the 1.145.0 milestone Oct 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants