{"id":50684243,"url":"https://github.com/veeso/pocket-ic-harness","last_synced_at":"2026-06-08T21:02:55.439Z","repository":{"id":348344417,"uuid":"1197656020","full_name":"veeso/pocket-ic-harness","owner":"veeso","description":"A test harness for Internet Computer canisters using PocketIC.","archived":false,"fork":false,"pushed_at":"2026-03-31T20:16:03.000Z","size":0,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-31T20:33:25.009Z","etag":null,"topics":["dfinity","ic","internet-computer","pocket-ic"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/veeso.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-31T19:07:07.000Z","updated_at":"2026-03-31T20:15:34.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/veeso/pocket-ic-harness","commit_stats":null,"previous_names":["veeso/pocket-ic-harness"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/veeso/pocket-ic-harness","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/veeso%2Fpocket-ic-harness","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/veeso%2Fpocket-ic-harness/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/veeso%2Fpocket-ic-harness/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/veeso%2Fpocket-ic-harness/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/veeso","download_url":"https://codeload.github.com/veeso/pocket-ic-harness/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/veeso%2Fpocket-ic-harness/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34080026,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-08T02:00:07.615Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dfinity","ic","internet-computer","pocket-ic"],"created_at":"2026-06-08T21:02:54.686Z","updated_at":"2026-06-08T21:02:55.430Z","avatar_url":"https://github.com/veeso.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pocket-ic-harness\n\n[![license-mit](https://img.shields.io/crates/l/pocket-ic-harness.svg?logo=rust)](https://opensource.org/licenses/MIT)\n[![repo-stars](https://img.shields.io/github/stars/veeso/pocket-ic-harness?style=flat)](https://github.com/veeso/pocket-ic-harness/stargazers)\n[![downloads](https://img.shields.io/crates/d/pocket-ic-harness.svg?logo=rust)](https://crates.io/crates/pocket-ic-harness)\n[![latest-version](https://img.shields.io/crates/v/pocket-ic-harness.svg?logo=rust)](https://crates.io/crates/pocket-ic-harness)\n[![conventional-commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-%23FE5196?logo=conventionalcommits\u0026logoColor=white)](https://conventionalcommits.org)\n\n[![ci](https://github.com/veeso/pocket-ic-harness/actions/workflows/ci.yml/badge.svg)](https://github.com/veeso/pocket-ic-harness/actions)\n[![docs](https://docs.rs/pocket-ic-harness/badge.svg?logo=rust)](https://docs.rs/pocket-ic-harness)\n\nA test harness for Internet Computer canisters using PocketIC.\n\n## Overview\n\npocket-ic-harness provides reusable utilities for integration testing IC canisters\nwith PocketIC:\n\n- **`Canister` trait** - define your canisters and their WASM paths\n- **`CanisterSetup` trait** - define how canisters are installed before each test\n- **`PocketIcTestEnv\u003cS\u003e`** - generic test environment with canister installation and registry\n- **`PocketIcClient`** - typed query/update calls with Candid encoding\n- **`init_new_agent()`** - create IC agents against PocketIC endpoints\n- **`#[pocket_ic_harness::test]`** - proc-macro for automatic setup/teardown\n\n## Quick Start\n\nDefine your canisters and setup:\n\n```rust\nuse std::path::Path;\nuse candid::Encode;\nuse pocket_ic_harness::{Canister, CanisterSetup, PocketIcTestEnv};\n\n#[derive(Debug, Clone, Hash, PartialEq, Eq)]\nenum MyCanister {\n    Backend,\n}\n\nimpl Canister for MyCanister {\n    fn as_path(\u0026self) -\u003e \u0026Path {\n        match self {\n            MyCanister::Backend =\u003e Path::new(\"path/to/backend.wasm.gz\"),\n        }\n    }\n}\n\nstruct MySetup;\n\nimpl CanisterSetup for MySetup {\n    type Canister = MyCanister;\n\n    async fn setup(env: \u0026mut PocketIcTestEnv\u003cSelf\u003e) {\n        let init_arg = Encode!(\u0026()).unwrap();\n        env.install_canister(MyCanister::Backend, init_arg).await;\n    }\n}\n```\n\nWrite tests with the proc-macro — canisters are already installed:\n\n```rust\n#[pocket_ic_harness::test]\nasync fn test_my_canister(ctx: PocketIcTestEnv\u003cMySetup\u003e) {\n    let canister_id = ctx.canister_id(\u0026MyCanister::Backend);\n    // test your canister...\n}\n```\n\n## Get Started\n\nAdd to your `Cargo.toml`:\n\n```toml\n[dev-dependencies]\npocket-ic-harness = \"0.1\"\n```\n\n## License\n\nLicensed under the MIT license. See [LICENSE](LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fveeso%2Fpocket-ic-harness","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fveeso%2Fpocket-ic-harness","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fveeso%2Fpocket-ic-harness/lists"}