본문으로 건너뛰기
Skillpedia
테스트75k · #2787

contract-testing

하는 일

이 스킬은 프런트엔드가 백엔드에 기대하는 내용을 기술하는 테스트를 작성하고, 실제 백엔드가 그것을 충족하는지 확인하는 방법을 설명합니다. 프런트엔드와 백엔드를 따로 배포하는 팀을 위한 스킬입니다.

사용하는 경우

  • ✓프런트엔드와 백엔드 변경이 자주 서로를 깨뜨릴 때.
  • ✓두 서비스가 함께 실행되어야 해서 종단 간 테스트가 느리고 불안정할 때.
  • ✓두 서비스를 독립적으로 배포할 수 있는지 알고 싶을 때.

스킬 링크

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

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

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.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“프런트엔드 앱과 API 사이에 계약 테스트를 설정해서, 백엔드 변경이 CI에서 문제를 일으키면 잡아 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트가 API 클라이언트에 Pact 소비자 테스트를 추가하고, 예상 계약을 Pact Broker에 게시하며, 백엔드 파이프라인에 제공자 검증을 추가합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 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

자주 묻는 질문

계약 테스트는 무엇인가요?

프런트엔드가 API에 기대하는 내용을 기록하고, 실제 API가 그 기대를 충족하는지 확인하는 테스트입니다.

스킬은 어떤 도구를 사용하나요?

Pact와 계약을 공유하는 Pact Broker입니다.

종단 간 테스트와는 어떻게 다른가요?

계약 테스트는 두 서비스를 동시에 실행할 필요가 없고, 불일치를 더 일찍 찾는다고 스킬은 설명합니다.

상세 정보

작성자의 원본 설명

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

인기도

GitHub 스타
75k
순위
#2787
라이선스
MIT
업데이트
2026. 10. 31.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬