contract-testing
하는 일
이 스킬은 프런트엔드가 백엔드에 기대하는 내용을 기술하는 테스트를 작성하고, 실제 백엔드가 그것을 충족하는지 확인하는 방법을 설명합니다. 프런트엔드와 백엔드를 따로 배포하는 팀을 위한 스킬입니다.
사용하는 경우
- ✓프런트엔드와 백엔드 변경이 자주 서로를 깨뜨릴 때.
- ✓두 서비스가 함께 실행되어야 해서 종단 간 테스트가 느리고 불안정할 때.
- ✓두 서비스를 독립적으로 배포할 수 있는지 알고 싶을 때.
스킬 링크
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/contract-testing/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
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.
인기도
- GitHub 스타
- 75k
- 순위
- #2787
- 라이선스
- MIT
- 업데이트
- 2026. 10. 31.
댓글
- …
이 저장소의 다른 스킬
frontendchecklist
75k명령줄 도구를 사용해 380개가 넘는 규칙으로 프런트엔드 코드와 실시간 페이지를 접근성, 속도, SEO, 보안 측면에서 점검합니다.
frontend-checklist-global
75kFront-End Checklist의 386개 규칙 전체로 프런트엔드 프로젝트를 감사하고, 발견한 문제마다 구체적인 해결 방법을 제시합니다.
404-page
75k없는 페이지 화면에 도움이 되는 링크가 있고 실제 404 상태 코드를 반환하는지 확인해, 길을 잃은 방문자를 돕습니다.
about-page
75k사이트를 운영하는 사람을 설명하는 명확한 소개 페이지가 있는지 검토해, 방문자와 검색 엔진의 신뢰를 높입니다.
비슷한 스킬
test-driven-development
311k에이전트가 기능이나 수정을 만들기 전에 실패하는 테스트를 먼저 쓰고, 그것을 통과시키는 가장 작은 코드를 작성하도록 가르칩니다.
verification-before-completion
311k에이전트가 작업, 수정, 빌드가 완료되었거나 통과했다고 말하기 전에 실제 점검을 실행하고 결과를 읽도록 가르칩니다.
migrate-to-shoehorn
310k테스트 파일의 위험한 타입 캐스팅을 shoehorn 라이브러리로 바꿔, 테스트가 일부 데이터만 써도 타입 검사를 통과하도록 돕습니다.