> For the complete documentation index, see [llms.txt](https://docs.decentraland.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.decentraland.org/contributor/contributor-pt/guias-para-colaboradores/testing-standards.md).

# Padrões de teste

Esta seção descreve a forma como os testes são feitos nos diferentes serviços e UIs nos projetos da Decentraland.

As palavras-chave "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY" e "OPTIONAL" neste documento devem ser interpretadas conforme descrito em [RFC 2119](https://datatracker.ietf.org/doc/html/rfc2119).

## Visão geral

Testar é uma parte crítica do nosso processo de desenvolvimento. Mantemos altos padrões de cobertura e qualidade de testes em todos os nossos projetos. Esta documentação fornece diretrizes abrangentes para:

* [**Escrever Testes**](/contributor/contributor-pt/guias-para-colaboradores/testing-standards/writing-tests.md) - Princípios e padrões gerais para escrever testes claros e de fácil manutenção
* [**Testar UIs**](/contributor/contributor-pt/guias-para-colaboradores/testing-standards/testing-uis.md) - Testar componentes React, sagas Redux, reducers, selectors e action creators
* [**Serviços de teste (Well-Known-Component)**](/contributor/contributor-pt/guias-para-colaboradores/testing-standards/testing-services-wkc.md) - Testar serviços modulares construídos com a arquitetura well-known-component
* [**Testar Serviços (Obsoleto)**](/contributor/contributor-pt/guias-para-colaboradores/testing-standards/testing-services-deprecated.md) - Abordagem legada para testar serviços (para referência)
* [**Testar End-to-End**](/contributor/contributor-pt/guias-para-colaboradores/testing-standards/testing-e2e.md) - Testes E2E com Cypress (Em andamento)

## Filosofia de Testes

Nossa abordagem de testes enfatiza:

* **Clareza** - Os testes devem ser autoexplicativos e fáceis de entender
* **Manutenibilidade** - Os testes devem ser fáceis de atualizar quando os requisitos mudam
* **Isolamento** - Cada teste deve ser executado de forma independente, sem afetar os demais
* **Cobertura** - Todos os caminhos críticos e casos extremos devem ser testados
* **Valor** - Os testes devem transmitir confiança de que o código funciona como pretendido

## Ligações Rápidas

* [Como descrever contextos com `describe`](/contributor/contributor-pt/guias-para-colaboradores/testing-standards/writing-tests.md#describing-and-building-context)
* [Como escrever expectativas com `it`](/contributor/contributor-pt/guias-para-colaboradores/testing-standards/writing-tests.md#describing-expectations-and-executing-code)
* [O que testar e quando](/contributor/contributor-pt/guias-para-colaboradores/testing-standards/writing-tests.md#what-to-test)
* [Quando e como fazer mock](/contributor/contributor-pt/guias-para-colaboradores/testing-standards/writing-tests.md#when-to-mock)

## Padrões Relacionados

* [Gerenciamento de Dependências](/contributor/contributor-pt/guias-para-colaboradores/dependency-management.md) - Gerenciando dependências npm e peerDependencies
* [Padrões de UI](https://github.com/decentraland/docs/tree/main/contributor/contributor-guides/ui-standards/README.md) - Padrões de Redux e RTK Query
* [Documentação da API](/contributor/contributor-pt/guias-para-colaboradores/api-documentation.md) - Padrões de documentação OpenAPI


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.decentraland.org/contributor/contributor-pt/guias-para-colaboradores/testing-standards.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
