Skip to content

Part 5c: Update test coverage instructions for Vitest 4 - #4315

Open
drmbilalkhalid wants to merge 1 commit into
fullstack-hy2020:sourcefrom
drmbilalkhalid:part5c-update-vitest4-coverage-config
Open

Part 5c: Update test coverage instructions for Vitest 4#4315
drmbilalkhalid wants to merge 1 commit into
fullstack-hy2020:sourcefrom
drmbilalkhalid:part5c-update-vitest4-coverage-config

Conversation

@drmbilalkhalid

Copy link
Copy Markdown

Vitest 4 only includes files covered by tests in the coverage report by
default, so the output can differ from the example shown in the course.

This adds a short note showing how to configure coverage.include in
vite.config.js so uncovered source files are also included in the report.

Copilot AI lite review requested due to automatic review settings August 11, 2026 17:06

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Updates the Part 5c course material to clarify a Vitest 4 behavior change where the coverage report only shows files touched by tests unless coverage is configured to include additional source files.

Changes:

  • Adds a note explaining Vitest 4 default coverage reporting behavior.
  • Adds an example configuration using test.coverage.include in vite.config.js to include uncovered source files in the report.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +814 to +819
test: {
// ...
coverage: {
include: ['src/**/*.{js,jsx}'],
},
},
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.

2 participants