mocking-microcks-typescriptlisted
Install: claude install-skill SebastienDegodez/skraft-plugin
# Mocking — Microcks x TypeScript adapter (default)
Serves the downstream API from its contract in a Microcks container and points the gateway
under test at the mock endpoint. Loaded ONLY when `mocking-strategy-roster` resolved
`(microcks, TypeScript)`.
**Boundary:** mock wiring + integration-test scaffold only. No business TDD, no provider
contract verification.
## Prerequisites
- devDependency `@microcks/microcks-testcontainers` (0.3.x, which brings `testcontainers`);
Docker reachable from the test run.
- The downstream contract (OpenAPI, plus `.apiexamples` when the examples live apart) under
`contracts/` or the location the `contract-testing` skill chose.
## Recipe — gateway against the Microcks mock
```ts
// tests/integration/{feature}/infrastructure/Http{Feature}Gateway.test.ts
// @vitest-environment node
import path from 'node:path'
import { MicrocksContainer, type StartedMicrocksContainer } from '@microcks/microcks-testcontainers'
import { afterAll, beforeAll, describe, expect, it } from 'vitest'
import { HttpRatesGateway } from '../../../../src/expenses/infrastructure/HttpRatesGateway'
let microcks: StartedMicrocksContainer
beforeAll(async () => {
microcks = await new MicrocksContainer()
.withMainArtifacts([path.resolve('contracts/rates-openapi.yaml')])
.start()
}, 120_000)
afterAll(async () => {
await microcks?.stop()
})
describe('HttpRatesGateway', () => {
it('should read the rate the contract example returns', async () => {
const