Saltar al contenido
Skillpedia
Pruebas75 mil · #2787

contract-testing

Qué hace

Esta skill explica cómo escribir pruebas que describen lo que espera el frontend del backend, y luego comprueban que el backend cumple esas expectativas. Es para equipos cuyo frontend y backend se despliegan por separado.

Cuándo usarla

  • ✓Cuando los cambios en el frontend y en el backend se rompen con frecuencia entre sí.
  • ✓Cuando las pruebas de extremo a extremo son lentas y frágiles porque ambos servicios deben ejecutarse juntos.
  • ✓Cuando quieres saber si dos servicios pueden desplegarse de forma independiente.

Link de la skill

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

Cópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.

Cómo usar

La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.

Mensaje listo para pegar

Usa esta skill para ayudarme: https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/contract-testing/SKILL.md Lee el archivo SKILL.md de ese link y sigue sus instrucciones en mi tarea.
¿Quieres que tu IA encuentre skills como esta por sí sola?Instala el MCP gratis de Skillpedia: una línea, y busca entre 15.000+ skills antes de cada tarea.Instalar en 1 minuto →

Ejemplo de qué pedirle a la IA

“Configura pruebas de contrato entre mi aplicación frontend y su API para que los cambios que rompen el backend se detecten en CI.”

5 skills nuevas por semana. 1 minuto de lectura.

Cómo funciona

Tu agente añade pruebas de consumidor de Pact para el cliente de la API, publica los contratos esperados en un broker y añade la verificación del proveedor al proceso del backend.

Contenido técnico (SKILL.md original)

Texto original del autor, en inglés, directo de 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

Preguntas frecuentes

¿Qué es una prueba de contrato?

Una prueba que registra lo que el frontend espera de una API y comprueba la API real frente a esas expectativas.

¿Qué herramienta usa la skill?

Pact, con un Pact Broker para compartir los contratos.

¿En qué se diferencia de las pruebas de extremo a extremo?

La skill indica que las pruebas de contrato no necesitan que ambos servicios estén en ejecución al mismo tiempo, y detectan incompatibilidades antes.

Detalles

Descripción original del autor

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

Popularidad

Estrellas en GitHub
75 mil
Posición en el ranking
#2787
Licencia
MIT
Actualizada
31/10/2026

¿Te sirve esta skill?

0

Entra para votar.

Comentarios

  • …

Más skills de este repositorio

Skills parecidas