Skip to content
Skillpedia
Testing75k · #2787

contract-testing

What it does

This skill explains how to write tests that describe what the frontend expects from the backend, then checks that the backend meets them. It is for teams whose frontend and backend are deployed separately.

When to use it

  • ✓When frontend and backend changes often break each other.
  • ✓When end-to-end tests are slow and fragile because both services must run together.
  • ✓When you want to know whether two services can be deployed independently.

Skill link

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/contract-testing/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/contract-testing/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute →

Example of what to ask your AI

“Set up contract tests between my frontend app and its API so breaking backend changes are caught in CI.”

5 new skills a week. 1 minute to read.

How it works

The agent adds Pact consumer tests for the API client, publishes the expected contracts to a broker, and adds provider verification to the backend pipeline.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Implement consumer-driven contract testing for API boundaries

Integration tests that require both services running at the same time are slow, brittle, and hard to maintain. Consumer-driven contract testing decouples the consumer and provider test suites — each team can run their tests independently, yet the broker guarantees that the published contract is always verified against the live provider. This catches API mismatches days earlier than end-to-end tests, with far less infrastructure overhead.

Quick Reference

  • The consumer writes tests that describe what it expects from the API (the "contract")
  • The contract is published to a Pact Broker and verified against the real provider
  • Provider changes that break the contract fail CI before they are deployed
  • This replaces fragile end-to-end tests that require both services to be running simultaneously

Check

Check whether the frontend has consumer-driven contract tests that define and verify the API contract with the backend.

Fix

Add Pact consumer tests for the frontend API client, publish the contracts to a broker, and add provider verification to the backend CI pipeline.

Explain

Explain how consumer-driven contract testing works, what the Pact workflow looks like end-to-end, and how it compares to mocking and end-to-end testing.

Code Review

Review the Pact consumer tests. Flag interactions that are too permissive (any-type matchers on fields the consumer actually uses), missing status code assertions, and interactions for endpoints the consumer no longer calls.


For full implementation details, code examples, and framework-specific guidance, see references/rule.md.

Rule page: https://frontendchecklist.io/rules/testing/contract-testing

FAQ

What is a contract test?

A test that records what the frontend expects from an API and checks the real API against those expectations.

Which tool does the skill use?

Pact, with a Pact Broker to share the contracts.

How is this different from end-to-end tests?

The skill says contract tests do not need both services running at the same time, and they catch mismatches earlier.

Details

Original description by the author

Use when setting up integration testing for a frontend-backend API boundary, evaluating whether two services are safe to deploy independently, or replacing slow end-to-end tests with contract tests.

repo: thedaviddias/Front-End-Checklist

Popularity

GitHub stars
75k
Ranking position
#2787
License
MIT
Updated
10/31/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills