FsHotWatch.Coverage 0.3.0-alpha.1

This is a prerelease version of FsHotWatch.Coverage.
dotnet add package FsHotWatch.Coverage --version 0.3.0-alpha.1
                    
NuGet\Install-Package FsHotWatch.Coverage -Version 0.3.0-alpha.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="FsHotWatch.Coverage" Version="0.3.0-alpha.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FsHotWatch.Coverage" Version="0.3.0-alpha.1" />
                    
Directory.Packages.props
<PackageReference Include="FsHotWatch.Coverage" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add FsHotWatch.Coverage --version 0.3.0-alpha.1
                    
#r "nuget: FsHotWatch.Coverage, 0.3.0-alpha.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package FsHotWatch.Coverage@0.3.0-alpha.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=FsHotWatch.Coverage&version=0.3.0-alpha.1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=FsHotWatch.Coverage&version=0.3.0-alpha.1&prerelease
                    
Install as a Cake Tool

FsHotWatch.Coverage

Plugin that checks code coverage thresholds after tests complete. It reads Cobertura XML coverage reports and compares line and branch coverage against per-project thresholds.

Why

Coverage checking is usually a separate CI step that runs after all tests. With FsHotWatch, the CoveragePlugin reacts to TestCompleted events and checks thresholds immediately, so you get instant feedback on whether your changes dropped coverage below the minimum.

How it works

  1. TestPrune runs your tests (with coverage flags)
  2. Tests produce Cobertura XML reports in the coverage directory
  3. CoveragePlugin receives TestCompleted
  4. It parses the XML reports and compares against thresholds
  5. Projects below threshold are reported as errors

Configuration

In .fs-hot-watch.json:

{
  "coverage": {
    "directory": "./coverage",
    "thresholdsFile": "coverage-thresholds.json"
  }
}
Field Type Default Description
directory string "./coverage" Directory containing Cobertura XML coverage reports.
thresholdsFile string -- Path to JSON file with per-project coverage thresholds.

Thresholds file format

{
  "MyApp.Tests.Unit": { "line": 85.0, "branch": 70.0 },
  "MyApp.Tests.Integration": { "line": 60.0, "branch": 50.0 }
}

Each key is a test project name. line and branch are minimum percentages (0-100). Projects not listed in the thresholds file are not checked.

CLI

# Query coverage results
fs-hot-watch coverage

Programmatic usage

daemon.RegisterHandler(
    CoveragePlugin.create
        "./coverage"                    // coverage report directory
        (Some "coverage-thresholds.json")  // thresholds file
        None                            // afterCheck callback
        None                            // getCommitId for caching
)

Install

dotnet add package FsHotWatch.Coverage
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.3.0-alpha.1 34 4/8/2026
0.1.0-alpha.1 49 4/3/2026