Developer Tooling & Quality Infrastructure
A higher-level testing experience on top of PocketIC.
IC Testkit is a small wrapper and helper layer around PocketIC, the local Internet Computer testing runtime. It doesn't replace PocketIC — it adds typed Candid calls, install helpers, cached baselines, deterministic identities, and benchmark reporting to reduce boilerplate and improve reproducibility.
What it is
Use PocketIC directly when you want the raw simulator API. Reach for IC Testkit when you want the conveniences a real test suite needs: typed Candid query and update helpers with contextual errors, install helpers, serialized PocketIC startup, cached baselines for expensive setup, deterministic fake principals, wasm artifact utilities, and compact benchmark reporting.
It resolves the PocketIC server binary for you — using a trusted path or a versioned cache — and fails with clear setup guidance instead of letting the underlying runtime panic.
Capabilities
Query/update helpers with contextual errors, caller-identity variants, and panic-on-transport helpers for fast failures.
Generic wasm install helpers, standalone fixtures, sequential batch installs, and install-code rate-limit retries.
Snapshot canisters once and restore them between tests; rebuild automatically if a cached instance has died.
Fake produces stable principals and account-like values from numeric seeds for predictable tests.
Build wasm packages into a dedicated target dir, check readiness, and verify generated .icp freshness.
Parse compact ICTK log markers into events, spans, aggregates, CSV files, and a Markdown summary.
Quick start
Add ic-testkit as a dev-dependency, acquire a serial guard, and use the Candid-aware Pic wrapper for common calls.
use ic_testkit::pic::{acquire_pic_serial_guard, pic}; #[test] fn calls_a_counter_canister() { let _guard = acquire_pic_serial_guard(); let pic = pic(); let counter = install_counter(&pic); let _: () = pic.update_call(counter, "increment", ()).unwrap(); let value: u64 = pic.query_call(counter, "get", ()).unwrap(); assert_eq!(value, 1); }
Who it's for
IC Testkit doesn't define application init payloads, endpoint names, role models, canister topology, benchmark labels, threshold policy, or CI failure policy. Those belong to the application or framework that owns the canisters under test.
See the full helper reference, benchmark format, and setup guide on GitHub.