Contract Testing
Contract testing with moclojer - validate API contracts, OpenAPI specs, and ensure frontend-backend compatibility with automated testing.
Use moclojer to validate API contracts between frontend and backend teams.
π― Approach
Define contract (OpenAPI spec)
Mock with moclojer (frontend development)
Validate backend matches contract
π OpenAPI Contract
# api-contract.yaml (OpenAPI 3.0)
openapi: 3.0.0
info:
title: Users API
version: 1.0.0
paths:
/users:
get:
responses:
'200':
content:
application/json:
schema:
type: array
items:
type: object
properties:
id:
type: integer
name:
type: stringπ§ͺ Test Contract
π See Also
Last updated
Was this helpful?