You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
var ShallowRenderer =require('react-test-renderer/shallow'); // ES5 with npm
14
14
```
15
15
16
-
## Overview
16
+
## 概要
17
17
18
-
When writing unit tests for React, shallow rendering can be helpful. Shallow rendering lets you render a component "one level deep" and assert facts about what its render method returns, without worrying about the behavior of child components, which are not instantiated or rendered. This does not require a DOM.
> We also recommend checking out Enzyme's [Shallow Rendering API](http://airbnb.io/enzyme/docs/api/shallow.html). It provides a nicer higher-level API over the same functionality.
54
+
> また Enzyme の [Shallow Rendering API](http://airbnb.io/enzyme/docs/api/shallow.html) をチェックすることをお勧めします。それは同じ機能上でより良くより高いレベルの API を提供します。
55
55
56
-
## Reference
56
+
## リファレンス
57
57
58
58
### `shallowRenderer.render()`
59
59
60
-
You can think of the shallowRenderer as a "place" to render the component you're testing, and from which you can extract the component's output.
`shallowRenderer.render()`is similar to [`ReactDOM.render()`](/docs/react-dom.html#render)but it doesn't require DOM and only renders a single level deep. This means you can test components isolated from how their children are implemented.
62
+
`shallowRenderer.render()`は [`ReactDOM.render()`](/docs/react-dom.html#render)に似ていますが、 DOM を必要とせず、1 階層だけレンダーします。つまり、テスト対象のコンポーネントが持つ子コンポーネントの実装から分離してテストを実行できます。
63
63
64
64
### `shallowRenderer.getRenderOutput()`
65
65
66
-
After `shallowRenderer.render()`has been called, you can use `shallowRenderer.getRenderOutput()`to get the shallowly rendered output.
0 commit comments