Crates.io | ic-test |
lib.rs | ic-test |
version | 0.3.4 |
created_at | 2025-04-03 14:16:24.844769+00 |
updated_at | 2025-08-25 23:00:01.599749+00 |
description | This tool helps to organize IC Rust canister testing as well as cross-testing between ICP and EVM. |
homepage | |
repository | https://github.com/wasm-forge/ic-test |
max_upload_size | |
id | 1618285 |
size | 350,938 |
ic-test is a command-line tool that helps to set up and manage Rust canister tests on the Internet Computer (IC) using. It makes it easier to create a test project and includes the basic files and setup needed for both IC canisters and optionally EVM (Ethereum Virtual Machine) smart contracts.
The tool reads the dfx.json
(must exist) and the foundry.toml
(may exist) files in order to build the test environment automatically. It uses pocket-ic
and alloy
(foundry) to run tests.
The generated code and helpers provide:
For more information, see the ic-test Book.
ic-test will:
dfx.json
to get canister details.foundry.toml
to get contract details..did
) files..sol
) files..wasm
canisters and .json
contract files in tests.cargo install ic-test
ic-test <COMMAND> [OPTIONS]
Without arguments it starts in interactive mode to create a new test project. If an ic-test.json
config file exists already, the "update" mode will regenerate the existing test project bindings.
ic-test new tests
Creates a new test project in the tests
folder.
Looks for canisters and contracts, generates API bindings and a sample test.
Generates the ic-test.json
configuration file.
Fails if the tests
folder already exists, the user would need to choose a different name.
ic-test update
Regenerates bindings using the configuration in ic-test.json
.
For other examples, see https://github.com/wasm-forge/ic-test-examples.
Licensed under MIT license.