Installation
Requirements
- Node.js ≥ 22.22
- A Docker-compatible container runtime – or Java 11+ to run without Docker locally
- Any test runner – the examples use Vitest
Install
- npm
- pnpm
- yarn
npm install --save-dev @hellaweb3/wiremock-testcontainers-nodejs
pnpm add --save-dev @hellaweb3/wiremock-testcontainers-nodejs
yarn add --dev @hellaweb3/wiremock-testcontainers-nodejs
pnpm ≥ 10 may report Ignored build scripts: ssh2, … – optional Testcontainers bindings, safe
to ignore.
Import it
ES modules:
examples/getting-started/esm.test.ts
import { WiremockContainer } from "@hellaweb3/wiremock-testcontainers-nodejs";
Source: examples/getting-started/esm.test.ts (lines 8–8)
CommonJS – the same API:
examples/getting-started/commonjs.test.ts
const { WiremockContainer } = require("@hellaweb3/wiremock-testcontainers-nodejs");
Source: examples/getting-started/commonjs.test.ts (lines 15–15)
The no-Docker helpers are also exported from @hellaweb3/wiremock-testcontainers-nodejs/no-docker.
Next: the quick start.