pic-js
1
总安装量
1
周安装量
#46286
全站排名
安装命令
npx skills add https://github.com/jorgenbuilder/icp-skills --skill pic-js
Agent 安装分布
replit
1
amp
1
opencode
1
kimi-cli
1
github-copilot
1
Skill 文档
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
- Install the PicJS package with the project package manager.
- Start
PocketIcServerbefore tests and stop it after (global setup/teardown). - Create a
PocketIcinstance fromPIC_URL. - Use
setupCanisterto install the canister and getactor/canisterId. - Tear down with
pic.tearDown()after each test (or after all tests).
Declarations
- Use
idlFactoryand_SERVICEfrom 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