API overview
Every export, with its guide and a tested example. Full signatures: API reference.
WiremockContainer
WiremockContainer – the builder. Also has every
GenericContainer method.
| API | Purpose | Guide | Example |
|---|---|---|---|
new WiremockContainer(image?) | Create the builder; pin the image | Guide | container.ts |
withCommand(args) | WireMock command-line options | Guide | container.ts |
withMappings(directory) | Copy mappings/ and __files/ of a directory | Guide | payments-api.ts |
withMapping(name, source) | One mapping file or inline stub(s) | Guide | stubs.ts |
withFiles(...sources) | Response bodies in __files/ | Guide | stubs.ts |
withExtension(extension) | A class name or TypeScript extension | Guide | java-extensions.e2e.test.ts |
withExtensions(extensions) | Several extensions, all or nothing | Guide | extensions.e2e.test.ts |
withExtensionJar(jar) | A JAR or directory of JARs on the class path | Guide | java-extensions.e2e.test.ts |
withExtensionJars(jars) | Several JARs or directories, all or nothing | Guide | java-extensions.e2e.test.ts |
withExtensionOptions(options) | Extension scanning and class-name verification | Guide | java-extensions.e2e.test.ts |
start() | Validate and start WireMock | Guide | lifecycle.e2e.test.ts |
StartedWiremockContainer
StartedWiremockContainer – what start() resolves
to. Also has every Testcontainers started-container method: stop(), logs(), await using, ….
| API | Purpose | Guide | Example |
|---|---|---|---|
rpcUrl | Base URL, e.g. http://localhost:32768 | Guide | lifecycle.e2e.test.ts |
getUrl(path?) | Absolute URL of a path | Guide | lifecycle.e2e.test.ts |
getAdminUrl() | <rpcUrl>/__admin | Guide | lifecycle.e2e.test.ts |
getMappingUrl() | <rpcUrl>/__admin/mappings | Guide | isolation.ts |
isRunning() | Whether WireMock is healthy; never throws | Guide | lifecycle.e2e.test.ts |
waitUntilReady(options?) | Poll until healthy | Guide | lifecycle.e2e.test.ts |
reset() | Registered stubs, restarted scenarios, empty journal | Guide | isolation.e2e.test.ts |
resetRequests() | Empty the journal only | Guide | isolation.e2e.test.ts |
countRequests(criteria) | Number of matching requests | Guide | verification.e2e.test.ts |
findRequests(criteria) | The matching requests | Guide | verification.e2e.test.ts |
new StartedWiremockContainer(container, url) | Created by start() – you do not call it | Guide | lifecycle.e2e.test.ts |
Running without Docker
Also exported from @hellaweb3/wiremock-testcontainers-nodejs/no-docker.
| API | Purpose | Guide | Example |
|---|---|---|---|
installNoDockerRuntime(options?) | Serve WireMock from a local JVM – local development only | Guide | no-docker.setup.ts |
isNoDockerRequested(env?) | Whether WIREMOCK_NO_DOCKER is 1 or true | Guide | vitest.config.ts |
detectCI(env?) | The CI/CD variable that is set, if any | Guide | no-docker.test.ts |
NO_DOCKER_ENV | "WIREMOCK_NO_DOCKER" | Guide | test-e2e.mjs |
Types
| API | Purpose | Guide | Example |
|---|---|---|---|
WiremockRequestCriteria | Request-matching criteria for the journal | Guide | verification.ts |
RecordedRequest | A request from the journal | Guide | verification.ts |
WaitUntilReadyOptions | timeout and interval of waitUntilReady() | Guide | lifecycle.ts |
WiremockStubMapping | A stub: request, response and more | Guide | stubs.ts |
WiremockMappingSource | What withMapping() accepts | Guide | stubs.ts |
WiremockFileSource | A path, URL, { file }, { module, file } or { package, file } | Guide | sources.ts |
WiremockStaticFile | A file source with an optional name | Guide | sources.ts |
WiremockPath | A path or file: URL | Guide | sources.ts |
WireMockExtension | The contract of TypeScript extensions | Guide | java-extension.ts |
ExtensionInput | What withExtension() accepts | Guide | registry.ts |
ExtensionConstructor | An extension class with a no-argument constructor | Guide | registry.ts |
WiremockExtensionJar | What withExtensionJar() accepts | Guide | jars.ts |
WiremockExtensionOptions | scanning and verifyClassNames | Guide | java-extensions.e2e.test.ts |
NoDockerOptions | Options of installNoDockerRuntime() | Guide | no-docker.ts |