noir-testing
Test Noir circuits using nargo test. Covers test attributes, assertions, and organization patterns.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Test Noir circuits using nargo test. Covers test attributes, assertions, and organization patterns.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Patterns for Noir circuit development: data types, stdlib, workspace setup. Use when working with Noir circuits in any capacity unless otherwise specified
Guidelines for writing idiomatic, efficient Noir programs. Use when writing or reviewing Noir code.
JavaScript/TypeScript integration with Noir circuits. Covers compilation, witness generation, proving, and verification using noir_js and bb.js.
Workflow for measuring and optimizing the ACIR circuit size of a constrained Noir program. Use when asked to optimize a Noir program's gate count or circuit size.
Review Noir circuits for correctness, constraint efficiency, and proof soundness. Use proactively after writing or modifying Noir circuits.
Web integration for Noir circuits. Covers React integration, Web Worker proving, WASM setup, and UX patterns for browser-based ZK applications.
| name | noir-testing |
| description | Test Noir circuits using nargo test. Covers test attributes, assertions, and organization patterns. |
| allowed-tools | Read, Grep, Glob, Edit, Write, Bash |
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