Cover the mutation sites the suite never reached.

git status can fail after rev-parse succeeds, and that empty-stderr
message was never executed. A non-numeric LCOV branch count never
reaches the hit check, so the dead handler is gone and the record
ignores it. JaCoCo's missing counter field and the Go report paths
were split onto lines the coverage report records. A callback stored
in a binding or passed to new stays inside its function, and an npm
coverage script does not install Vitest. mutator --mutate-all on the
changed Python files: 709 killed, 0 survived, 0 uncovered.

Co-authored-by: Robert C. Martin <[email protected]>
This commit is contained in:
Cursor Agent
2026-11-26 00:11:55 +00:00
co-authored by Robert C. Martin
parent c0ba1e13ba
commit 8e491a636a
5 changed files with 67 additions and 12 deletions
+20
View File
@@ -76,6 +76,26 @@ def test_existing_coverage_script_is_left_alone(tmp_path):
assert command == ["npm", "run", "coverage"]
def test_an_npm_coverage_script_does_not_install_a_provider(tmp_path, monkeypatch):
_write(
tmp_path,
"package.json",
json.dumps({"scripts": {"coverage": "vitest run --coverage"}}),
)
source = _write(tmp_path, "src/app.ts", "export function view() { return 1 }\n")
commands = []
monkeypatch.setattr(
"crapper.runners.run_shell",
lambda command, cwd: commands.append(list(command)) or 0,
)
monkeypatch.setattr(
"crapper.runners._ensure_vitest_coverage",
lambda package: (_ for _ in ()).throw(AssertionError(package)),
)
assert run_coverage(tmp_path, [source], None) == 0
assert commands == [["npm", "run", "coverage"]]
def test_node_test_script_still_uses_c8(tmp_path):
_write(tmp_path, "package.json", json.dumps({"scripts": {"test": "node --test"}}))
report_dir = tmp_path / "target" / "coverage" / "typescript"