npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

testpilot-dotnet

v0.1.4

Published

AI-powered .NET unit test gap finder and generator

Downloads

583

Readme

testpilot-dotnet

AI-powered unit test gap finder and writer for .NET projects.

TestPilot scans your ASP.NET Core, Optimizely CMS, or Umbraco CMS project, finds classes with missing or incomplete tests, and writes production-ready unit tests using Claude AI — matching your team's existing style, frameworks, and naming conventions.

Installation

No installation needed — use npx:

npx testpilot-dotnet <command>

Or install globally:

npm install -g testpilot-dotnet
testpilot-dotnet <command>

Requirements

  • Node.js 18+
  • .NET SDK 6 / 8 / 9 / 10
  • Anthropic API key set as an environment variable:
# Windows
set ANTHROPIC_API_KEY=sk-ant-...

# macOS / Linux
export ANTHROPIC_API_KEY=sk-ant-...

Get an API key at console.anthropic.com.

Quick Start

Run these commands inside your .NET solution directory:

npx testpilot-dotnet init        # Detect project configuration
npx testpilot-dotnet scan        # Find missing tests
npx testpilot-dotnet report      # View the gap report
npx testpilot-dotnet generate    # Write the missing tests

CI Integration (GitHub Actions)

TestPilot can run automatically on every push and commit generated tests back to your branch.

One-time setup — run this in your .NET project:

npx testpilot-dotnet ci-setup

This creates .github/workflows/testpilot.yml in your repo. Then:

  1. Add your Anthropic API key as a GitHub secret:
    • Repo → Settings → Secrets → Actions → New repository secret
    • Name: ANTHROPIC_API_KEY
  2. Commit and push the workflow file

From that point on, every push to a feature branch will:

  • Detect which source files changed
  • Scan those files for missing tests
  • Generate and build-verify the tests
  • Commit the test files back to the same branch automatically

Commits made by TestPilot include [testpilot skip] so they never retrigger the workflow.

Commands

testpilot-dotnet init

Scans your solution and creates a .testpilot.json config file. Reads all .csproj files to auto-detect your test framework, mocking library, and CMS version.

| Option | Description | |---|---| | -y, --yes | Overwrite existing config without prompting |

testpilot-dotnet scan

Analyzes your source code and existing tests, then produces a gap report saved to .testpilot.gaps.json.

testpilot-dotnet generate

Generates missing test files based on the gap report.

| Option | Description | |---|---| | --dry-run | Preview what would be generated without writing files | | --max-files <n> | Limit number of test files to generate | | --file <path> | Generate tests for a specific source file only | | --gap-type <type> | Filter by gap type: no-test-class, no-tests, missing-scenarios | | --min-priority <level> | Minimum priority: critical, high, medium, low |

testpilot-dotnet report

Displays the gap report in the terminal.

| Option | Description | |---|---| | --output terminal | Human-readable output (default) | | --output json | JSON format | | --output markdown | Markdown format |

testpilot-dotnet ci-setup

Generates a GitHub Actions workflow file that runs TestPilot on every push.

| Option | Description | |---|---| | --platform <name> | CI platform: github (default) | | --dotnet-version <ver> | .NET SDK version for the workflow (default: 8.x) | | --node-version <ver> | Node.js version for the workflow (default: 20) |

testpilot-dotnet ci-run

Runs the full CI pipeline: detect changed files → scan → generate → optionally commit. Intended for use inside CI pipelines, not locally.

| Option | Description | |---|---| | --commit | Commit and push generated test files back to the branch | | --base <sha> | Git SHA to diff against (defaults to HEAD~1 or TESTPILOT_BASE_SHA env var) |

Supported Frameworks

| Category | Supported | |---|---| | Test frameworks | xUnit, NUnit, MSTest | | Mocking | Moq, NSubstitute, FakeItEasy | | Test data | AutoFixture, Bogus | | CMS | Optimizely CMS 12+, Umbraco CMS 13+ / 17+ | | .NET versions | .NET 6, 8, 9, 10+ |

All frameworks are auto-detected from your .csproj PackageReference elements — no manual configuration needed.

Configuration

testpilot-dotnet init creates a .testpilot.json file. All fields default to "auto":

{
  "solution": "./MySite.sln",
  "sourceProjects": ["src/MySite.Web"],
  "testProjects": ["tests/MySite.Web.Tests"],
  "testFramework": "auto",
  "mockingLibrary": "auto",
  "namingConvention": "MethodName_Scenario_ExpectedResult",
  "patterns": {
    "include": ["**/*.cs"],
    "exclude": ["**/Migrations/**", "**/obj/**"]
  }
}

How It Works

  1. Detect — Reads .csproj files to identify frameworks, libraries, and CMS version
  2. Scan — Analyzes source classes to find testable methods and business logic
  3. Match — Compares source against existing tests to find gaps
  4. Generate — Uses Claude AI to write tests matching your team's style
  5. Verify — Runs dotnet build to ensure generated tests compile, auto-fixes up to 3 times

What TestPilot Will NOT Do

  • Modify your source code — it only writes inside test projects
  • Test auto-generated code (EF migrations, .g.cs, designer files)
  • Overwrite existing test methods — it appends only
  • Generate tests for thin CRUD-delegation classes with no real logic