Mikro Ön Uçlar Arasında Sözleşme Testi
Sözleşme testinin, mikro ön uçların sunduğu ve kullandığı arayüzlerin uyumlu kalmasını nasıl doğruladığını ve dağıtımdan önce geriye dönük uyumsuz değişiklikleri nasıl yakaladığını öğrenin.
Mikro Ön Uçlar Arasında Sözleşme Testi, CoddyKit'te ücretsiz bir Micro Frontends Architecture with Module Federation dersidir. Bu, 4 dersinin 4. dersidir. Aşağıdan dersin tamamını ücretsiz okuyabilir, sonra tarayıcıda yerleşik kod editörü ve 7/24 yapay zeka koçu ile uygulamalı olarak pratik yapabilirsin. Bu, Micro Frontends Architecture with Module Federation öğrenme yolunun bir parçasıdır ve ilerlemeniz web ve CoddyKit uygulaması arasında senkronize olur. Micro Frontends Architecture with Module Federation kursu toplamda 4 dersten oluşur.
Bu dersin bazı bölümleri henüz çevrilmemiş olup İngilizce olarak gösterilmektedir.
The Integration Gap
Unit tests check one MFE in isolation; E2E tests are slow and brittle. Contract testing fills the gap by verifying the agreements between MFEs without running everything together.
What Is a Contract?
A contract is the shape of an interaction between two parties — the exposed module signature, an event payload, or a shared state shape. Both sides must agree on it.
Consumer-Driven Contracts
In consumer-driven contract testing, the consumer defines what it expects from a provider. The provider then verifies it actually meets those expectations.
Contracts in Federation
For micro frontends, contracts commonly cover:
- Exposed module props/signatures
- Custom event names and payloads
- Shared state structure
- Shared API response shapes
A Props Contract Example
If a remote exposes a Widget, the consumer expects specific props. The contract records those expectations explicitly.
// consumer expects:
// <Widget productId: number, onAdd: function />Writing a Consumer Expectation
The consumer writes a test describing the interface it relies on, generating a contract artifact the provider can check against.
expectInterface("cart/Widget", {
props: { productId: "number", onAdd: "function" }
});Verifying on the Provider Side
The provider runs a verification test confirming its exposed module still satisfies every consumer contract before it deploys.
verifyContracts("cart/Widget"); // fails if props changedEvent Contract Testing
For event-based communication, the contract pins the event name and payload schema, so renaming an event or dropping a field is caught immediately.
{ event: "cart:add", detail: { productId: "number" } }Where Contracts Live
Store contracts in a shared location (a broker or repo) both teams can access. Tools like Pact provide a broker; a shared schema package is a simpler alternative.
Fitting into CI
Run provider contract verification in CI on every change. A broken contract fails the build before the incompatible MFE can reach production.
Benefits of Contract Testing
Contract tests give you:
- Fast feedback without full integration
- Confidence to deploy independently
- Early detection of breaking interface changes
- Clear, documented interfaces between teams
Quick Check
Test your contract-testing knowledge.
Recap
You learned contract testing for MFEs:
- Contracts capture agreements on props, events, and state
- Consumers define expectations; providers verify them
- Store contracts in a broker or shared schema
- Run verification in CI to block breaking changes
- Enables confident independent deployment
Contract tests are the fast middle layer of the MFE testing pyramid.
Sıkça Sorulan Sorular
“Mikro Ön Uçlar Arasında Sözleşme Testi” dersi ücretsiz mi?
Evet — “Mikro Ön Uçlar Arasında Sözleşme Testi” dersin tüm metni burada web'de ücretsiz olarak okunabilir. Etkileşimli olarak pratik yapmak (yerleşik kod editörü ve 7/24 yapay zeka koçu) ve Micro Frontends Architecture with Module Federation kursunun geri kalanını açmak için CoddyKit PRO'ya yükselt. Micro Frontends Architecture with Module Federation kursu toplamda 4 dersten oluşur.
“Mikro Ön Uçlar Arasında Sözleşme Testi” dersinde ne öğreneceğim?
Sözleşme testinin, mikro ön uçların sunduğu ve kullandığı arayüzlerin uyumlu kalmasını nasıl doğruladığını ve dağıtımdan önce geriye dönük uyumsuz değişiklikleri nasıl yakaladığını öğrenin. Micro Frontends Architecture with Module Federation ile uygulamalı kodu tarayıcıda doğrudan çalıştırarak pratik yaparsın ve 7/24 yapay zeka koçu dersi çalışırken sorularını yanıtlar.
Micro Frontends Architecture with Module Federation öğrenmeye başlamak için deneyim gerekli mi?
Önceden deneyim gerekmez. CoddyKit'te Micro Frontends Architecture with Module Federation, başlangıçtan ileri seviyeye kadar yapılandırıldığı için buradan başlayabilir veya başından başlayıp kendi hızında ilerleme yapabilirsin. Bu, 4 dersinin 4. dersidir.
“Mikro Ön Uçlar Arasında Sözleşme Testi” dersi ne kadar sürer?
Çoğu CoddyKit dersi yaklaşık 5–10 dakika sürer. Her biri kısa ve etkileşimli olduğu için sabit ilerleme yaparsın ve web ile uygulama arasında tam olarak bıraktığın yerden devam edebilirsin.
Bu Micro Frontends Architecture with Module Federation dersinde kod yazıp çalıştırabilir miyim?
Evet. Her Micro Frontends Architecture with Module Federation dersi yerleşik bir kod editörü içerir, bu sayede tarayıcıda gerçek kod yazıp çalıştırabilir ve anlık yapay zeka geri bildirimi alırsın — yerel kurulum gerekli değildir.
Bu kursun tüm dersleri
- Federasyon Bileşenlerinde Birim Testleri
- Entegrasyon Testi Stratejileri
- Uygulamalar Arasında Uçtan Uca Test
- Mikro Ön Uçlar Arasında Sözleşme Testi