nmbl Documentation
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage
Edit page

test - Run Tests

Overview

The test command runs dotnet test for your solution or project and displays a formatted, color-coded results table grouped by project, along with a timing summary. It wraps the standard dotnet test runner and presents the output in a more readable format.

Syntax

nmbl test [path] [options]

Arguments

  • path - Optional path to a solution file (.slnx, .sln), project file (.csproj), or directory. Defaults to the current directory.

Options

  • --output <format>, -o <format> - Output format: table (default), json, or markdown
  • --no-format - Skip nmbl formatting and use the raw dotnet test output
  • --no-color - Disable color coding in the results table

Output

The default table output shows:

===== Test Results by Project =====
|------------------------------------------|-----------|--------|--------|---------|-------|-----------|
| Project                                  | Status    | Passed | Failed | Skipped | Total | Duration  |
|------------------------------------------|-----------|--------|--------|---------|-------|-----------|
| MyProject.Tests                          | Passed    |     52 |      0 |       0 |    52 | 0.09s     |
| MyProject.IntegrationTests               | Failed    |     10 |      2 |       1 |    13 | 1.23s     |
|------------------------------------------|-----------|--------|--------|---------|-------|-----------|

===== Failing Tests: MyProject.IntegrationTests =====
|------------------------------|--------------------------------|
| Test Class                   | Test Method                    |
|------------------------------|--------------------------------|
| DatabaseTests_SaveOrder      | ThrowsExceptionGivenInvalidId  |
| EmailServiceTests_SendEmail  | ReturnsFailureGivenBadAddress  |
|------------------------------|--------------------------------|

===== Timing Summary =====
Restore: 1.54s
Build: 23.33s
Test: 18.15s
------------------------
Total: 43.02s

✗ Pipeline failed! 2 test(s) failed.

Status Colors

  • Green — All tests in the project passed
  • Red — One or more tests failed
  • Yellow — Some tests were skipped but none failed

Failing Tests Table

When tests fail, the output includes a separate table for each project showing the first 10 failing tests:

  • Test Class — The test class name (typically the last segment before the method name)
  • Test Method — The test method name

This table appears after the project results table and before the timing summary, making it easy to identify which specific tests need attention.

Examples

Run Tests in Current Directory

nmbl test

Discovers and runs all test projects in the current directory tree.

Run Tests for a Specific Solution

nmbl test MySolution.slnx

Runs all test projects found in the solution.

Run Tests for a Single Project

nmbl test src/MyProject.Tests/MyProject.Tests.csproj

Runs tests for the specified project only.

Output as Markdown Table

nmbl test --output markdown

Produces a Markdown-formatted table suitable for pasting into a PR description or wiki.

Output as JSON

nmbl test --output json

Outputs structured JSON for use in scripts or CI pipelines.

Disable Color

nmbl test --no-color

Useful in environments that do not support ANSI color codes.

Skip nmbl Formatting

nmbl test --no-format

Passes through the raw dotnet test console output without any transformation.

  • cc - Calculate cyclomatic complexity
  • cogc - Calculate cognitive complexity
  • regions - Count region directives