Help us improve
Share bugs, ideas, or general feedback.
From noir
Test Noir circuits using nargo test. Covers test attributes, assertions, and organization patterns.
npx claudepluginhub critesjosh/noir-claude-plugin --plugin noirHow this skill is triggered — by the user, by Claude, or both
Slash command
/noir:noir-testingThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Noir has a built-in test framework that runs alongside your circuit code using `nargo test`. Tests are constrained by default, meaning they generate real constraints and verify circuit behavior under proving conditions.
Guides writing and running Cairo smart-contract tests with snforge: unit, integration, fuzz, fork, and regression tests. Covers cheatcode usage, coverage, and test strategy.
Verification by compilation and execution. Translates a Compact claim into a minimal test contract, compiles it with the Compact CLI, runs the compiled output with @midnight-ntwrk/compact-runtime, and interprets the result. Loaded by the contract-writer agent. Covers workspace setup (lazy init), contract writing, compilation, runner script creation, execution, and result interpretation. References midnight-tooling:compact-cli for compilation details.
Guides smart contract testing with Foundry: unit tests, fuzzing, fork testing, invariant testing. Use when writing tests for Solidity contracts.
Share bugs, ideas, or general feedback.
Noir has a built-in test framework that runs alongside your circuit code using nargo test. Tests are constrained by default, meaning they generate real constraints and verify circuit behavior under proving conditions.
.nr files as circuit code, or in separate test modulesunconstrained to run tests without constraint generation (faster, but less thorough)nargo# Run all tests in the project
nargo test
# Run a specific test by exact name
nargo test --exact test_addition
# Run tests matching a prefix
nargo test test_transfer
# Show println output during tests
nargo test --show-output
fn add(x: Field, y: Field) -> Field {
x + y
}
#[test]
fn test_add() {
assert_eq(add(2, 3), 5);
}
#[test(should_fail_with = "attempt to divide by zero")]
fn test_divide_by_zero() {
let _ = 1 / 0;
}
#[test]
unconstrained fn test_add_unconstrained() {
// Runs faster without constraint generation
assert_eq(add(2, 3), 5);
}
#[test], should_fail, constrained vs unconstrainedassert, assert_eq, debugging with println