Skip to content

Generate msw handlers from each spec alongside the client #120

Description

@ExtraToast

What to build

Mock handlers are generated from each spec and published alongside the client, so tests mock the contract instead of a hand-written guess.

Today mocking is done three incompatible ways: a declared but entirely unused interception library in two applications, a large hand-written route mock file with hand-typed fixtures in a third, and module-level mocking of the generated client in unit tests — which means no test exercises transport, base URL, auth headers or CSRF.

Generated handlers become the default because a contract change should move the mocks, and because per-test overrides are what stateful login and streaming flows need.

Acceptance criteria

  • Handlers are derived from the spec and shipped with the client
  • A single response can be overridden per test without abandoning the generated set
  • Handlers work both in component tests and in the browser-driven suite
  • Regenerating produces no diff when the spec has not changed

Blocked by

  • Emit TanStack Vue Query artifacts behind a subpath export

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: toolingReusable workflows, Gradle, templates, Renovate, and API tooling.component: testsUnit, integration, system, or contract test concern.priority: P2Medium; normal planned work.type: testTest coverage, fixtures, or validation changes.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions