Run WireMock with JavaScript/TypeScript tests using Testcontainers for Node.js
npm install @wiremock/wiremock-testcontainers-nodeWireMock module for Testcontainers for NodeJS
``bash`
npm install wiremock-testcontainers-node
Add a stub mapping json file (eg. mapping.json)
`js
import { WireMockContainer } from "wiremock-testcontainers-node";
const container = await new WireMockContainer()
.withMapping("./mapping.json")
.withExposedPorts(8080)
.start();
const { output, exitCode } = await container.exec([
"curl",
"http://localhost:8080/hello",
]);
console.log(output);
await container.stop();
``