wiremock / wiremock-testcontainers-node

WireMock module for Testcontainers for NodeJS

Home Page:https://wiremock.org/docs/solutions/testcontainers/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

wiremock-testcontainers-node

example workflow

WireMock module for Testcontainers for NodeJS

Usage

npm install @wiremock/wiremock-testcontainers-node --save-dev

Add a stub mapping json file (eg. mapping.json)

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();

About

WireMock module for Testcontainers for NodeJS

https://wiremock.org/docs/solutions/testcontainers/

License:Apache License 2.0


Languages

Language:JavaScript 100.0%