Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion codeflash/languages/javascript/vitest_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,21 @@ def run_vitest_behavioral_tests(
# Pre-creating an empty directory may cause vitest to delete it
logger.debug(f"Coverage will be written to: {coverage_dir}")

vitest_cmd.extend(["--coverage", "--coverage.reporter=json", f"--coverage.reportsDirectory={coverage_dir}"])
vitest_cmd.extend(
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.

Why we are disabling coverage here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

not disabling but removing the thresholds only

[
"--coverage",
"--coverage.reporter=json",
f"--coverage.reportsDirectory={coverage_dir}",
# Disable project-level coverage thresholds to prevent false failures.
# Codeflash-generated tests typically cover only a single function (~1-2% of codebase),
# which would fail projects with thresholds like 70% lines/functions configured
# in their vitest.config.ts.
"--coverage.thresholds.lines=0",
"--coverage.thresholds.functions=0",
"--coverage.thresholds.statements=0",
"--coverage.thresholds.branches=0",
]
)
# Note: Removed --coverage.enabled=true (redundant) and --coverage.all false
# The version mismatch between vitest and @vitest/coverage-v8 can cause
# issues with coverage flag parsing. Let vitest use default settings.
Expand Down
Loading