Repository navigation
test: add mock reset configuration and test coverage support - #338159
Merged
Merged
Conversation
- 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.
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The V8 coverage provider is configured but not declared as a chat-lib dependency.
Review effort: Balanced
Findings: 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`).
Dmitriy Vasyura (dmitrivMS)
enabled auto-merge (squash)
October 30, 2026 23:07
Dmitriy Vasyura (dmitrivMS)
approved these changes
Oct 30, 2026
Raymond Zhao (rzhao271)
approved these changes
Oct 30, 2026
Alexandru Dima (alexdima)
approved these changes
Oct 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Relates to #338158