Pular para o conteúdo
Skillpedia
Testes75 mil · #2787

contract-testing

O que ela faz

Esta skill explica como escrever testes que descrevem o que o front end espera do back end, e depois verificam se o back end atende a essas expectativas. Ela é para equipes cujo front end e back end são implantados separadamente.

Quando usar

  • ✓Quando alterações no front end e no back end costumam quebrar uma à outra.
  • ✓Quando os testes de ponta a ponta são lentos e frágeis porque os dois serviços precisam rodar juntos.
  • ✓Quando você quer saber se dois serviços podem ser implantados de forma independente.

Link da skill

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

Copie e cole na sua IA (Claude, ChatGPT ou Cursor) pedindo para seguir as instruções.

Como usar

O jeito mais fácil: copie a mensagem e cole na sua IA. Ela lê a skill e segue as instruções.

Mensagem pronta para colar

Use esta skill para me ajudar: https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/contract-testing/SKILL.md Leia o arquivo SKILL.md desse link e siga as instruções dele na minha tarefa.
Quer que a sua IA encontre skills como esta sozinha?Instale o MCP grátis do Skillpedia: uma linha, e ela pesquisa entre 15.000+ skills antes de cada tarefa.Instalar em 1 minuto →

Exemplo do que pedir para a IA

“Configure testes de contrato entre meu app front end e a API para que mudanças que quebrem o back end sejam detectadas no CI.”

5 skills novas por semana. 1 minuto de leitura.

Como funciona

O agente adiciona testes de consumidor Pact para o cliente da API, publica os contratos esperados em um broker e adiciona a verificação do provedor ao pipeline do back end.

Conteúdo técnico (SKILL.md original)

Texto original do autor, em inglês, direto do 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

Perguntas frequentes

O que é um teste de contrato?

Um teste que registra o que o front end espera de uma API e verifica a API real contra essas expectativas.

Qual ferramenta a skill usa?

Pact, com um Pact Broker para compartilhar os contratos.

Em que isso difere dos testes de ponta a ponta?

A skill diz que testes de contrato não exigem que os dois serviços estejam rodando ao mesmo tempo, e detectam incompatibilidades mais cedo.

Detalhes

Descrição original do 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

Popularidade

Estrelas no GitHub
75 mil
Posição no ranking
#2787
Licença
MIT
Atualizada em
31/10/2026

Essa skill é útil?

0

Entre para votar.

Comentários

  • …

Mais skills deste repositório

Skills parecidas