From b583059e5fc5ae54b0f05a2249414b6b964d4a3b Mon Sep 17 00:00:00 2001 From: Francisco Joshua Date: Fri, 8 Feb 2019 18:01:06 +0200 Subject: [PATCH 01/17] Update reference-test-renderer.md --- content/docs/reference-test-renderer.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/docs/reference-test-renderer.md b/content/docs/reference-test-renderer.md index 473dfb7ec..a1248e7cd 100644 --- a/content/docs/reference-test-renderer.md +++ b/content/docs/reference-test-renderer.md @@ -1,6 +1,6 @@ --- id: test-renderer -title: Test Renderer +title: Testando o Renderer permalink: docs/test-renderer.html layout: docs category: Reference From f6a438b87ab8404d3f849373c8f113d35ed3da93 Mon Sep 17 00:00:00 2001 From: Francisco Joshua Date: Fri, 8 Feb 2019 18:59:58 +0200 Subject: [PATCH 02/17] Update reference-test-renderer.md --- content/docs/reference-test-renderer.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/content/docs/reference-test-renderer.md b/content/docs/reference-test-renderer.md index a1248e7cd..2cda174e0 100644 --- a/content/docs/reference-test-renderer.md +++ b/content/docs/reference-test-renderer.md @@ -6,20 +6,20 @@ layout: docs category: Reference --- -**Importing** +**Importando** ```javascript import TestRenderer from 'react-test-renderer'; // ES6 -const TestRenderer = require('react-test-renderer'); // ES5 with npm +const TestRenderer = require('react-test-renderer'); // ES5 com npm ``` -## Overview {#overview} +## Visão Geral {#overview} This package provides a React renderer that can be used to render React components to pure JavaScript objects, without depending on the DOM or a native mobile environment. Essentially, this package makes it easy to grab a snapshot of the platform view hierarchy (similar to a DOM tree) rendered by a React DOM or React Native component without using a browser or [jsdom](https://github.com/tmpvar/jsdom). -Example: +Exemplo: ```javascript import TestRenderer from 'react-test-renderer'; From 287ffddb502bd58d52f2ecb01111c567de4b42a1 Mon Sep 17 00:00:00 2001 From: Francisco Joshua Date: Fri, 8 Feb 2019 19:11:37 +0200 Subject: [PATCH 03/17] Update reference-test-renderer.md --- content/docs/reference-test-renderer.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/content/docs/reference-test-renderer.md b/content/docs/reference-test-renderer.md index 2cda174e0..e3f83209a 100644 --- a/content/docs/reference-test-renderer.md +++ b/content/docs/reference-test-renderer.md @@ -15,9 +15,9 @@ const TestRenderer = require('react-test-renderer'); // ES5 com npm ## Visão Geral {#overview} -This package provides a React renderer that can be used to render React components to pure JavaScript objects, without depending on the DOM or a native mobile environment. +Este pacote fornece um renderizador React que pode ser usado para renderizar componentes React para objetos JavaScript puros, sem depender do DOM ou de um ambiente móvel nativo. -Essentially, this package makes it easy to grab a snapshot of the platform view hierarchy (similar to a DOM tree) rendered by a React DOM or React Native component without using a browser or [jsdom](https://github.com/tmpvar/jsdom). +Essencialmente, esse pacote facilita a captura de um instantâneo da hierarquia de visualização da plataforma (semelhante a uma árvore DOM) processada por um componente React DOM ou React Native sem usar um navegador ou [jsdom](https://github.com/tmpvar/jsdom). Exemplo: @@ -38,9 +38,9 @@ console.log(testRenderer.toJSON()); // children: [ 'Facebook' ] } ``` -You can use Jest's snapshot testing feature to automatically save a copy of the JSON tree to a file and check in your tests that it hasn't changed: [Learn more about it](http://facebook.github.io/jest/blog/2016/07/27/jest-14.html). +Você pode usar o recurso de teste de instantâneo do Jest para salvar automaticamente uma cópia da árvore JSON em um arquivo e verificar em seus testes que ela não foi alterada: [Aprenda mais sobre isso](http://facebook.github.io/jest/blog/2016/07/27/jest-14.html). -You can also traverse the output to find specific nodes and make assertions about them. +Você também pode percorrer o resultado para encontrar nós específicos e fazer verificações sobre eles. ```javascript import TestRenderer from 'react-test-renderer'; @@ -94,7 +94,7 @@ expect(testInstance.findByProps({className: "sub"}).children).toEqual(['Sub']); * [`testInstance.parent`](#testinstanceparent) * [`testInstance.children`](#testinstancechildren) -## Reference {#reference} +## Referência {#reference} ### `TestRenderer.create()` {#testrenderercreate} @@ -102,7 +102,7 @@ expect(testInstance.findByProps({className: "sub"}).children).toEqual(['Sub']); TestRenderer.create(element, options); ``` -Create a `TestRenderer` instance with the passed React element. It doesn't use the real DOM, but it still fully renders the component tree into memory so you can make assertions about it. The returned instance has the following methods and properties. +Cria uma instância do `TestRenderer` com o elemento React fornecido. Este método não usa o DOM real, mas ainda renderiza completamente a árvore de componentes na memória para que você possa fazer verificações sobre ela. A instância retornada possui os seguintes métodos e propriedades. ### `testRenderer.toJSON()` {#testrenderertojson} From 6940163912b52b4f9a590e0a421cb485664caed5 Mon Sep 17 00:00:00 2001 From: Francisco Joshua Date: Wed, 20 Feb 2019 12:57:28 +0200 Subject: [PATCH 04/17] Update reference-test-renderer.md --- content/docs/reference-test-renderer.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/content/docs/reference-test-renderer.md b/content/docs/reference-test-renderer.md index e3f83209a..e5ffdd1c6 100644 --- a/content/docs/reference-test-renderer.md +++ b/content/docs/reference-test-renderer.md @@ -230,7 +230,7 @@ The props corresponding to this test instance. For example, a `