-
Notifications
You must be signed in to change notification settings - Fork 299
Fix: Translate Testing Overview doc to Spanish #275
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
9684492
Fix: Translate Testing Overview doc to spanish
rootlinux2 24d6619
Update content/docs/testing.md
rootlinux2 ac4ad14
Update content/docs/testing.md
rootlinux2 5170227
Update content/docs/testing.md
rootlinux2 3d7d549
Update content/docs/testing.md
rootlinux2 0a2b1f2
Update content/docs/testing.md
rootlinux2 363fec7
Update content/docs/testing.md
rootlinux2 8e5201b
Update content/docs/testing.md
rootlinux2 86808a2
Update content/docs/testing.md
rootlinux2 e3c53cd
Update testing.md
Darking360 ad32600
Update testing.md
Darking360 b045869
Update testing.md
Darking360 d88a632
Update testing.md
Darking360 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,40 @@ | ||
--- | ||
id: testing | ||
title: Testing Overview | ||
title: Visión general de Pruebas | ||
permalink: docs/testing.html | ||
redirect_from: | ||
- "community/testing.html" | ||
next: testing-recipes.html | ||
--- | ||
|
||
You can test React components similar to testing other JavaScript code. | ||
Puedes probar un componente de React similar a como pruebas otro código JavaScript. | ||
|
||
There are a few ways to test React components. Broadly, they divide into two categories: | ||
Hay varias formas de probar un componente React, la mayoría se agrupan en dos categorías: | ||
|
||
* **Rendering component trees** in a simplified test environment and asserting on their output. | ||
* **Running a complete app** in a realistic browser environment (also known as “end-to-end” tests). | ||
* **Renderizado del árbol de componentes** en un entorno de prueba simplificado y comprobando sus salidas. | ||
* **Ejecutando la aplicación completa** en un entorno de prueba más realista utilizando un navegador web (más conocido como pruebas “end-to-end”). | ||
|
||
This documentation section focuses on testing strategies for the first case. While full end-to-end tests can be very useful to prevent regressions to important workflows, such tests are not concerned with React components in particular, and are out of scope of this section. | ||
Esta sección de la documentación está enfocada en estrategias de prueba para el primer caso. Mientras las pruebas de tipo “end-to-end” pueden ser muy útiles para prever regresiones a flujos de trabajos importantes, estas pruebas no están relacionadas con los componentes React particularmente y están fuera del alcance de esta sección. | ||
|
||
### Tradeoffs {#tradeoffs} | ||
### Concesiones {#tradeoffs} | ||
|
||
|
||
When choosing testing tools, it is worth considering a few tradeoffs: | ||
Cuando estás eligiendo las herramientas para realizar las pruebas, vale la pena considerar algunas Concesiones: | ||
|
||
* **Iteration speed vs Realistic environment:** Some tools offer a very quick feedback loop between making a change and seeing the result, but don't model the browser behavior precisely. Other tools might use a real browser environment, but reduce the iteration speed and are flakier on a continuous integration server. | ||
* **How much to mock:** With components, the distinction between a "unit" and "integration" test can be blurry. If you're testing a form, should its test also test the buttons inside of it? Or should a button component have its own test suite? Should refactoring a button ever break the form test? | ||
* **Velocidad de iteración vs Entorno realista:** Algunas herramientas ofrecen un ciclo de retroalimentación muy rápido entre hacer un cambio y ver el resultado, pero no modelan el comportamiento del navegador con precisión. Otras herramientas pueden usar un entorno de navegador real, pero reducen la velocidad de iteración y son menos confiables en un servidor de integración continua. | ||
* **Cuanto abarcar:** Cuando pruebas componentes la diferencia entre Prueba Unitaria y Prueba de Integración puede ser borrosa. Si estas probando un formulario, se deben probar los botones del formulario en esta prueba? O el componente del botón debe tener su propia suit de pruebas? Debería la refactorización del botón afectar el resultado de las pruebas del formulario? | ||
|
||
Different answers may work for different teams and products. | ||
Diferentes respuestas pueden funcionar para diferentes equipos y diferentes productos. | ||
|
||
### Recommended Tools {#tools} | ||
### Herramientas recomendadas {#tools} | ||
|
||
**[Jest](https://facebook.github.io/jest/)** is a JavaScript test runner that lets you access the DOM via [`jsdom`](#mocking-a-rendering-surface). While jsdom is only an approximation of how the browser works, it is often good enough for testing React components. Jest provides a great iteration speed combined with powerful features like mocking [modules](#mocking-modules) and [timers](#mocking-timers) so you can have more control over how the code executes. | ||
**[Jest](https://facebook.github.io/jest/)** Es una biblioteca de JavaScript para ejecución de pruebas que permite acceder al DOM mediante [`jsdom`](/docs/testing-environments.html#mocking-a-rendering-surface). Aunque JSDOM solo se aproxima a como realmente los navegadores web trabajan, usualmente es suficiente para probar los componentes React. Jest brinda una gran velocidad de iteración combinada con potentes funcionalidades como simular [módulos](/docs/testing-environments.html#mocking-modules) y [temporizadores](/docs/testing-environments.html#mocking-timers) esto permite tener mayor control sobre como se ejecuta el código. | ||
|
||
**[React Testing Library](https://testing-library.com/react)** is a set of helpers that let you test React components without relying on their implementation details. This approach makes refactoring a breeze and also nudges you towards best practices for accessibility. Although it doesn't provide a way to "shallowly" render a component without its children, a test runner like Jest lets you do this by [mocking](/docs/testing-recipes.html#mocking-modules). | ||
**[Biblioteca de Pruebas para React](https://testing-library.com/react)** es una biblioteca de utilidades que te ayudan a probar componentes React sin depender de los detalles de su implementación. Este enfoque simplifica la refactorización y también lo empuja hacia las mejores prácticas de accesibilidad, aunque no proporciona una forma de renderizar "superficialmente" un componente sin sus hijos, Jest te permite hacerlo gracias a su funcionalidad para [simular](/docs/testing-recipes.html#mocking-modules). | ||
|
||
### Learn More {#learn-more} | ||
### Más Información {#learn-more} | ||
|
||
This section is divided in two pages: | ||
Esta sección esta dividida en dos paginas: | ||
|
||
- [Recipes](/docs/testing-recipes.html): Common patterns when writing tests for React components. | ||
- [Environments](/docs/testing-environments.html): What to consider when setting up a testing environment for React components. | ||
- [Recetas](/docs/testing-recipes.html): Patrones comunes cuando escribes pruebas para componentes React. | ||
- [Entornos](/docs/testing-environments.html): Que debes considerar cuando estes configurando un entorno de pruebas para componentes React. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.