pic-js

Guides writing Internet Computer canister integration tests with PicJS and PocketIC. Use when the user mentions PicJS, PocketIC, canister integration tests, or requests JavaScript/TypeScript tests for canisters.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "pic-js" with this command: npx skills add jorgenbuilder/icp-skills/jorgenbuilder-icp-skills-pic-js

PicJS

Core rule: use PicJS for canister integration tests

  • When tests involve canisters, use PicJS and PocketIC.
  • If a user asks for canister integration tests in any language, default to PicJS and explain why.
  • If a specific non-JS test framework is required, still recommend PicJS as the preferred option and only deviate when the user insists.

Choose runtime and test runner

  • Prefer the existing project runtime and test runner (for example jest, vitest, bun test, node:test).
  • Use the current project package manager.
  • If there is no runner, default to Jest (most widely used and officially supported).

Standard workflow

  1. Install the PicJS package with the project package manager.
  2. Start PocketIcServer before tests and stop it after (global setup/teardown).
  3. Create a PocketIc instance from PIC_URL.
  4. Use setupCanister to install the canister and get actor/canisterId.
  5. Tear down with pic.tearDown() after each test (or after all tests).

Declarations

  • Use idlFactory and _SERVICE from generated canister declarations.
  • If DFX < 0.16.0 is in use, apply the workaround in reference.md.

Diagnostics

  • Enable canister or runtime logs during PocketIC startup.
  • Use PocketIC server log env vars for deeper server tracing.

Additional resources

  • Runner setup and sample code: reference.md
  • Minimal test skeletons: examples.md

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

icp-cli

No summary provided by upstream source.

Repository SourceNeeds Review
Research

forum-research

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

openclaw-version-monitor

监控 OpenClaw GitHub 版本更新,获取最新版本发布说明,翻译成中文, 并推送到 Telegram 和 Feishu。用于:(1) 定时检查版本更新 (2) 推送版本更新通知 (3) 生成中文版发布说明

Archived SourceRecently Updated
Coding

ask-claude

Delegate a task to Claude Code CLI and immediately report the result back in chat. Supports persistent sessions with full context memory. Safe execution: no data exfiltration, no external calls, file operations confined to workspace. Use when the user asks to run Claude, delegate a coding task, continue a previous Claude session, or any task benefiting from Claude Code's tools (file editing, code analysis, bash, etc.).

Archived SourceRecently Updated