contract-testing
यह क्या करती है
यह स्किल समझाती है कि ऐसे टेस्ट कैसे लिखें जो बताते हैं कि फ़्रंटएंड बैकएंड से क्या उम्मीद करता है, फिर जाँचें कि बैकएंड उन्हें पूरा करता है। यह उन टीमों के लिए है जिनके फ़्रंटएंड और बैकएंड अलग-अलग डिप्लॉय होते हैं।
कब इस्तेमाल करें
- ✓जब फ़्रंटएंड और बैकएंड के बदलाव अक्सर एक-दूसरे को तोड़ते हैं।
- ✓जब end-to-end टेस्ट धीमे और नाज़ुक हैं, क्योंकि दोनों सेवाएँ साथ चलनी चाहिए।
- ✓जब आप जानना चाहते हैं कि दो सेवाएँ स्वतंत्र रूप से डिप्लॉय हो सकती हैं या नहीं।
Skill का लिंक
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/contract-testing/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“मेरे फ़्रंटएंड ऐप और उसके API के बीच contract टेस्ट सेट करें, ताकि CI में बैकएंड के तोड़ने वाले बदलाव पकड़े जाएँ।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
एजेंट API क्लाइंट के लिए Pact consumer टेस्ट जोड़ता है, अपेक्षित contracts को एक broker पर प्रकाशित करता है, और बैकएंड पाइपलाइन में provider verification जोड़ता है।
तकनीकी सामग्री (मूल 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
अक्सर पूछे जाने वाले सवाल
contract टेस्ट क्या है?
ऐसा टेस्ट जो दर्ज करता है कि फ़्रंटएंड API से क्या उम्मीद करता है, और असली API को उन अपेक्षाओं से जाँचता है।
स्किल कौन-सा टूल इस्तेमाल करती है?
Pact, contracts साझा करने के लिए Pact Broker के साथ।
यह end-to-end टेस्ट से कैसे अलग है?
स्किल कहती है कि contract टेस्ट को दोनों सेवाएँ एक साथ चलाने की ज़रूरत नहीं होती, और वे बेमेल पहले पकड़ते हैं।
जानकारी
लेखक का मूल विवरण
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
- अपडेट की गई
- 31/10/2026
कमेंट
- …
इस repository की और skills
frontendchecklist
75kकमांड-लाइन टूल से फ़्रंटएंड कोड और लाइव पेजों को एक्सेसिबिलिटी, स्पीड, SEO और सिक्योरिटी के 380 से ज़्यादा नियमों से जाँचती है।
frontend-checklist-global
75kफ़्रंटएंड प्रोजेक्ट को Front-End Checklist के सभी 386 नियमों से ऑडिट करती है, और हर मिली समस्या का ठोस समाधान देती है।
404-page
75kजाँचती है कि आपका गुम पेज उपयोगी लिंक देता है और सही 404 स्टेटस लौटाता है, ताकि भटके हुए विज़िटर रास्ता ढूँढ सकें।
about-page
75kजाँचती है कि आपकी साइट पर एक साफ़ About पेज है जो बताता है कि उसे कौन चलाता है, ताकि विज़िटर और सर्च इंजन का भरोसा बढ़े।
मिलती-जुलती skills
test-driven-development
311kयह आपके एजेंट को किसी भी फ़ीचर या सुधार से पहले पहले असफल होने वाला टेस्ट लिखना, उसे असफल होते देखना, फिर पास करने वाला सबसे छोटा कोड लिखना सिखाती है।
verification-before-completion
311kयह आपके एजेंट को किसी काम, सुधार या build के पूरा या पास होने का दावा करने से पहले असली जांच चलाकर उसका आउटपुट पढ़ना सिखाती है।
migrate-to-shoehorn
310kआपकी टेस्ट फ़ाइलों में जोखिम भरे type casts की जगह shoehorn लाइब्रेरी लगाती है, ताकि टेस्ट अधूरे डेटा से भी type checks पास कर सकें।