contract-testing

Implement consumer-driven contract testing with Pact.js for JavaScript/TypeScript applications.

1|Updated Mar 6, 2026
One-click install
npx skills add https://github.com/chavangorakh1999/sde-skills --skill contract-testing-chavangorakh1999
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: contract-testing
Source: https://github.com/chavangorakh1999/sde-skills/tree/main/sde-testing/skills/contract-testing
Command: npx skills add https://github.com/chavangorakh1999/sde-skills --skill contract-testing-chavangorakh1999

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @pact-foundation/pact, ajv, ajv-formats, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill prevents breaking changes between microservices or APIs by ensuring consumers and providers adhere to agreed-upon contracts, avoiding runtime integration failures.

Core Features & Use Cases

  • Consumer-Driven Contracts: Define expected API interactions from the consumer's perspective.
  • Provider Verification: Automatically verify that the provider's implementation fulfills these contracts.
  • CI Integration: Seamlessly integrate contract testing into your CI/CD pipeline to catch regressions early.
  • Use Case: When your frontend team (consumer) defines how it expects to receive user data from the backend API (provider), contract testing ensures the backend doesn't change the data format without the frontend's knowledge.

Quick Start

Use the contract-testing skill to set up consumer-driven contract tests for your user service API.

Frequently Asked Questions about contract-testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What is consumer-driven contract testing in microservices?

Consumer-driven contract testing verifies API compatibility by defining interactions from the consumer's perspective. It prevents breaking changes in microservice architectures by ensuring providers fulfill agreed-upon contracts before deployment.

How do I verify API contracts between consumers and providers using Pact?

Using Pact.js, you define expected API interactions from the consumer side and automatically verify that the provider's implementation fulfills these contracts. This catches integration failures early in your development cycle.

Can I integrate contract testing into my CI/CD pipeline?

Yes, contract testing integrates seamlessly into CI/CD pipelines using Pact Broker. It automatically verifies consumer-driven contracts during builds to catch API regressions and prevent breaking changes from reaching production.

What is the difference between Pact and JSON Schema validation for API testing?

Pact provides full consumer-driven contract testing verifying interactions between consumers and providers. JSON Schema validation via ajv serves as a lightweight alternative focusing strictly on validating data formats rather than full interaction flows.

Does this contract testing Skill work with TypeScript applications?

Yes, this Skill implements consumer-driven contract testing using Pact.js for JavaScript and TypeScript applications. It verifies API contracts to solve integration failures in microservice architectures across both environments.