diff --git a/content/docs/reference-test-renderer.md b/content/docs/reference-test-renderer.md
index 3de2d5752e..4b4e9c773b 100644
--- a/content/docs/reference-test-renderer.md
+++ b/content/docs/reference-test-renderer.md
@@ -6,20 +6,20 @@ layout: docs
category: Reference
---
-**Importing**
+**如何引入**
```javascript
import TestRenderer from 'react-test-renderer'; // ES6
const TestRenderer = require('react-test-renderer'); // ES5 with npm
```
-## Overview {#overview}
+## 概览 {#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.
+这个 package 提供了一个 React 渲染器,用于将 React 组件渲染成纯 JavaScript 对象,无需依赖 DOM 或原生移动环境。
-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).
+这个 package 提供的主要功能是在不依赖浏览器或 [jsdom](https://github.com/tmpvar/jsdom) 的情况下,返回某个时间点由 React DOM 或者 React Native 平台渲染出的视图结构(类似与 DOM 树)快照。
-Example:
+示例:
```javascript
import TestRenderer from 'react-test-renderer';
@@ -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](https://facebook.github.io/jest/blog/2016/07/27/jest-14.html).
+你可以使用 Jest 的快照测试功能来自动保存当前 `JSON` 树结构到一个文件中,并在测试中检查它是否被修改:[了解更多](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.
+你也可以通过遍历输出来查找特定节点,并对它们进行断言。
```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}
+## 参考 {#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.
+通过传来的 React 元素创建一个 `TestRenderer` 实例。它并不使用真实的 DOM,但是它依然将组件树完整地渲染到内存,以便于你对它进行断言。返回的实例拥有以下的方法和属性。
### `testRenderer.toJSON()` {#testrenderertojson}
@@ -110,7 +110,7 @@ Create a `TestRenderer` instance with the passed React element. It doesn't use t
testRenderer.toJSON()
```
-Return an object representing the rendered tree. This tree only contains the platform-specific nodes like `
` or `` and their props, but doesn't contain any user-written components. This is handy for [snapshot testing](https://facebook.github.io/jest/docs/en/snapshot-testing.html#snapshot-testing-with-jest).
+返回一个已渲染的的树对象。该树仅包含特定平台的节点,例如 `
` 或 `` 和它们的 props,但并不包含任何用户编写的组件。这对于[快照测试](http://facebook.github.io/jest/docs/en/snapshot-testing.html#snapshot-testing-with-jest)非常方便。
### `testRenderer.toTree()` {#testrenderertotree}
@@ -118,7 +118,7 @@ Return an object representing the rendered tree. This tree only contains the pla
testRenderer.toTree()
```
-Return an object representing the rendered tree. Unlike `toJSON()`, the representation is more detailed than the one provided by `toJSON()`, and includes the user-written components. You probably don't need this method unless you're writing your own assertion library on top of the test renderer.
+返回一个已渲染的的树对象。和 `toJSON()` 不同,它表示的内容比 `toJSON()` 提供的内容要更加详细,并且包含用户编写的组件。除非你要在测试渲染器(test renderer)之上编写自己的断言库,否则你可能并不需要这个方法。
### `testRenderer.update()` {#testrendererupdate}
@@ -126,7 +126,7 @@ Return an object representing the rendered tree. Unlike `toJSON()`, the represen
testRenderer.update(element)
```
-Re-render the in-memory tree with a new root element. This simulates a React update at the root. If the new element has the same type and key as the previous element, the tree will be updated; otherwise, it will re-mount a new tree.
+使用新的根元素重新渲染内存中的树。它模拟根元素的一次 React 更新。如果新的元素和之前的元素有相同的 type 和 key,该树将会被更新;否则,它将重挂载一个新树。
### `testRenderer.unmount()` {#testrendererunmount}
@@ -134,7 +134,7 @@ Re-render the in-memory tree with a new root element. This simulates a React upd
testRenderer.unmount()
```
-Unmount the in-memory tree, triggering the appropriate lifecycle events.
+卸载内存中的树,会触发相应的生命周期事件。
### `testRenderer.getInstance()` {#testrenderergetinstance}
@@ -142,7 +142,7 @@ Unmount the in-memory tree, triggering the appropriate lifecycle events.
testRenderer.getInstance()
```
-Return the instance corresponding to the root element, if available. This will not work if the root element is a function component because they don't have instances.
+如果可用的话,返回与根元素相对应的实例。如果根元素是函数定义组件,该方法无效,因为函数定义组件没有实例。
### `testRenderer.root` {#testrendererroot}
@@ -150,7 +150,7 @@ Return the instance corresponding to the root element, if available. This will n
testRenderer.root
```
-Returns the root "test instance" object that is useful for making assertions about specific nodes in the tree. You can use it to find other "test instances" deeper below.
+返回根元素“测试实例”对象,它对于断言树中的特定节点十分有用。你可以利用它来查找其他更深层的“测试实例”。
### `testInstance.find()` {#testinstancefind}
@@ -158,7 +158,7 @@ Returns the root "test instance" object that is useful for making assertions abo
testInstance.find(test)
```
-Find a single descendant test instance for which `test(testInstance)` returns `true`. If `test(testInstance)` does not return `true` for exactly one test instance, it will throw an error.
+找到一个 `test(testInstance)` 返回 `true` 的后代测试实例。如果不只有一个测试实例匹配,将会报错。
### `testInstance.findByType()` {#testinstancefindbytype}
@@ -166,7 +166,7 @@ Find a single descendant test instance for which `test(testInstance)` returns `t
testInstance.findByType(type)
```
-Find a single descendant test instance with the provided `type`. If there is not exactly one test instance with the provided `type`, it will throw an error.
+找到匹配指定 `type` 的后代测试实例,如果不是只有一个测试实例匹配指定的 `type`,将会报错。
### `testInstance.findByProps()` {#testinstancefindbyprops}
@@ -174,7 +174,7 @@ Find a single descendant test instance with the provided `type`. If there is not
testInstance.findByProps(props)
```
-Find a single descendant test instance with the provided `props`. If there is not exactly one test instance with the provided `props`, it will throw an error.
+找到匹配指定 `props`的后代测试实例,如果不是正好只有一个测试实例匹配指定的 `props`,将会报错。
### `testInstance.findAll()` {#testinstancefindall}
@@ -182,7 +182,7 @@ Find a single descendant test instance with the provided `props`. If there is no
testInstance.findAll(test)
```
-Find all descendant test instances for which `test(testInstance)` returns `true`.
+找到所有 `test(testInstance)` 返回 `true` 的后代测试实例。
### `testInstance.findAllByType()` {#testinstancefindallbytype}
@@ -190,7 +190,7 @@ Find all descendant test instances for which `test(testInstance)` returns `true`
testInstance.findAllByType(type)
```
-Find all descendant test instances with the provided `type`.
+找到所有匹配指定 `type` 的后代测试实例。
### `testInstance.findAllByProps()` {#testinstancefindallbyprops}
@@ -198,7 +198,7 @@ Find all descendant test instances with the provided `type`.
testInstance.findAllByProps(props)
```
-Find all descendant test instances with the provided `props`.
+找到所有匹配指定 `props` 的后代测试实例。
### `testInstance.instance` {#testinstanceinstance}
@@ -206,7 +206,7 @@ Find all descendant test instances with the provided `props`.
testInstance.instance
```
-The component instance corresponding to this test instance. It is only available for class components, as function components don't have instances. It matches the `this` value inside the given component.
+该测试实例相对应的组件实例。它只能用于类定义组件,因为函数定义组件没有实例。它匹配给定的组件内部的 `this` 的值。
### `testInstance.type` {#testinstancetype}
@@ -214,7 +214,7 @@ The component instance corresponding to this test instance. It is only available
testInstance.type
```
-The component type corresponding to this test instance. For example, a `` component has a type of `Button`.
+该测试实例相对应的组件的类型。例如,一个 `` 组件有一个 `Button` 类型。
### `testInstance.props` {#testinstanceprops}
@@ -222,7 +222,7 @@ The component type corresponding to this test instance. For example, a `` component has `{size: 'small'}` as props.
+该测试实例相对应的组件的 props。例如,一个 `` 组件的 props 为 `{size: 'small'}`。
### `testInstance.parent` {#testinstanceparent}
@@ -230,7 +230,7 @@ The props corresponding to this test instance. For example, a `