Skip to content

Enable V8 coverage in tests#5

Open
IvanGoncharov wants to merge 1 commit intobackend-zigfrom
vitest
Open

Enable V8 coverage in tests#5
IvanGoncharov wants to merge 1 commit intobackend-zigfrom
vitest

Conversation

@IvanGoncharov
Copy link
Member

No description provided.

Copilot AI review requested due to automatic review settings March 7, 2026 12:40
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Enables V8-based code coverage for the Vitest test suite and adjusts code to satisfy strict coverage requirements.

Changes:

  • Configure Vitest to collect V8 coverage with 100% thresholds.
  • Run vitest with --coverage in the testonly script and add the V8 coverage provider dependency.
  • Add/adjust coverage ignore directives in a few source files.

Reviewed changes

Copilot reviewed 5 out of 7 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
vitest.config.ts Adds V8 coverage configuration, include/exclude globs, and 100% thresholds.
src/viz.ts Simplifies option passing to _renderInput; adds a coverage ignore marker for a debug-only method.
src/instance.ts Adds coverage ignore markers to WASI shims used for debugging / Graphviz compatibility.
src/dotviz-worker.ts Wraps the worker entrypoint in V8 ignore markers (currently untested).
package.json Adds @vitest/coverage-v8 and enables coverage in testonly.
package-lock.json Locks new dependency tree for coverage provider (and pins vitest to an exact version).
.gitignore Ignores the coverage/ output directory.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@IvanGoncharov IvanGoncharov requested a review from Copilot March 8, 2026 18:27
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

coverage: {
provider: 'v8',
include: ['src/**/*.ts', 'test/**/*.ts'],
exclude: ['**/*.d.ts', 'test/types/'],
Copy link

Copilot AI Mar 8, 2026

Choose a reason for hiding this comment

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

coverage.exclude uses test/types/, but coverage.include includes test/**/*.ts. Since coverage exclusion matching is path-based, test/types/ is unlikely to exclude the TypeScript files under that directory (e.g. test/types/render-options.ts), which would cause 0% coverage and fail the 100% thresholds. Use an explicit glob like test/types/** (or alternatively remove test/**/*.ts from coverage.include if the intent is to measure only production code coverage).

Suggested change
exclude: ['**/*.d.ts', 'test/types/'],
exclude: ['**/*.d.ts', 'test/types/**'],

Copilot uses AI. Check for mistakes.
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