Skip to content

Mutation gate passes a package whose mutated set is empty (CONST-T3) #29

Description

@ryanleecode

Problem

pnpm mutation passes for a package whose mutate globs match no mutable code, for example a package that holds only schema declarations. CONST-T3 says "let an empty mutated set pass" is forbidden, but no command enforces it, so the rule is ungated.

Evidence

  • @systemfsoftware/stryker-js@13.1.0 CHANGELOG.md:102: a run whose mutate patterns match no file "finishes successfully ... and passes regardless of thresholds.break".
  • The runner logs "No valid mutant was tested, so there is no mutation score to hold against break threshold" and exits 0 (MutationScore.Unscored).
  • @systemfsoftware/stryker-ignorer-effect-schema-declarations ignores mutants inside schema declarations, so a schema-only package reaches zero mutants even when its globs match files.

Expected

A package's mutation task fails when zero mutants were tested, unless the package opts out explicitly in its mutation config (the escape hatch CONST-T13 describes for test-set verdicts).

Acceptance

  • A package whose src contains only *.schema.ts files fails pnpm mutation with a message naming the empty mutated set.
  • A package with at least one killed mutant still passes.
  • The opt-out is a visible config field, not a suppression comment.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions