
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
pic-js-mops
Advanced tools
An Internet Computer Protocol canister testing library for TypeScript and JavaScript.
Pic JS is a library for interacting with a local instance of pocket-ic from TypeScript.
The pocket-ic is a canister testing platform for the Internet Computer. It is a standalone executable that can be used to test canisters locally, without the need to deploy them to a full replica.
Other languages available include Python and Rust.
npm i -D @dfinity/pic
Install peer dependencies if they are not already installed:
npm i -D @dfinity/{agent,candid,identity,principal}
The easiest way to use PocketIC is to use setupCanister convenience method:
import { PocketIc } from '@dfinity/pic';
import { _SERVICE, idlFactory } from '../declarations';
const wasmPath = resolve('..', '..', 'canister.wasm');
const pic = await PocketIc.create();
const fixture = await pic.setupCanister<_SERVICE>(idlFactory, wasmPath);
const { actor } = fixture;
// perform tests...
await pic.tearDown();
If more control is needed, then the createCanister, installCode and createActor methods can be used directly:
import { PocketIc } from '@dfinity/pic';
import { _SERVICE, idlFactory } from '../declarations';
const wasmPath = resolve('..', '..', 'canister.wasm');
const pic = await PocketIc.create();
const canisterId = await pic.createCanister();
await pic.installCode(canisterId, wasmPath);
const actor = pic.createActor<_SERVICE>(idlFactory, canisterId);
// perform tests...
await pic.tearDown();
More detailed documentation is available over at dfinity.github.io/pic-js.
All examples are written in TypeScript with Jest as the test runner,
but @dfinity/pic can be used with JavaScript and any other testing runner, such as NodeJS, bun or Mocha.
FAQs
An Internet Computer Protocol canister testing library for TypeScript and JavaScript.
The npm package pic-js-mops receives a total of 1,439 weekly downloads. As such, pic-js-mops popularity was classified as popular.
We found that pic-js-mops demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.