https://github.com/wiremock/wiremock-testcontainers-node
WireMock module for Testcontainers for NodeJS
https://github.com/wiremock/wiremock-testcontainers-node
hacktoberfest javascript nodejs testcontainers testcontainers-module wiremock
Last synced: 6 months ago
JSON representation
WireMock module for Testcontainers for NodeJS
- Host: GitHub
- URL: https://github.com/wiremock/wiremock-testcontainers-node
- Owner: wiremock
- License: apache-2.0
- Created: 2023-10-11T09:22:58.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-09T18:32:00.000Z (over 1 year ago)
- Last Synced: 2024-05-09T18:53:09.328Z (over 1 year ago)
- Topics: hacktoberfest, javascript, nodejs, testcontainers, testcontainers-module, wiremock
- Language: JavaScript
- Homepage: https://wiremock.org/docs/solutions/testcontainers/
- Size: 98.6 KB
- Stars: 10
- Watchers: 3
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# wiremock-testcontainers-node

WireMock module for [Testcontainers for NodeJS](https://node.testcontainers.org/)
## Usage
```bash
npm install @wiremock/wiremock-testcontainers-node --save-dev
```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();
```