PSMutant
0.2.2
Mutation testing for PowerShell. Injects small faults (flip -eq to -ne, $true to $false, N to N+1, drop -not) into your scripts using the PowerShell AST and reports how many your Pester suite catches - the metric line coverage cannot give you. Runs mutants in a throwaway sandbox so your source is never modified.
Minimum PowerShell version
7.2
Installation Options
Owners
Copyright
(c) Fortigi. MIT licensed.
Package Details
Author(s)
- Fortigi
Tags
mutation-testing testing pester ast quality test-quality coverage
Functions
Invoke-PSMutation Get-PSMutationCandidate Set-PSMutationText
Dependencies
-
- Pester (>= 5.0.0)
Release Notes
Fixes a silent, entirely fake 100% score on any machine with two Pester versions installed. Mutants run in a child runspace, and that runspace resolved Pester by name - getting the newest version installed rather than the one already loaded. Assemblies are per-process, so the child died on an incompatible Pester.dll, produced no verdict, and a mutant with no verdict was counted as Killed: every mutant died and the run reported a perfect score over tests that never ran. The child is now pinned to the loaded module's path, and a run that cannot evaluate a mutant fails instead of scoring it. Also fixes an abort when a suitable Pester was already loaded. Coverage and self-mutation both at 100%.
FileList
- PSMutant.nuspec
- LICENSE
- PSMutant.psd1
- PSMutant.psm1
- README.md
- src\Invoke-PSMutation.ps1
- src\PSMutation.Config.ps1
- src\PSMutation.Operators.ps1
- src\PSMutation.Recheck.ps1
- src\PSMutation.Report.ps1
- src\PSMutation.Runner.ps1
- src\PSMutation.Sandbox.ps1
Version History
| Version | Downloads | Last updated |
|---|---|---|
| 0.2.2 (current version) | 5 | 8/18/2026 |
| 0.2.1 | 5 | 8/18/2026 |
| 0.2.0 | 6 | 8/17/2026 |
| 0.1.0 | 81 | 7/3/2026 |