Skip to content

Commit 588587a

Browse files
Merge pull request #44 from vermasachin/shallow-renderer
Translated shallow renderer
2 parents 84265b6 + a3bfc05 commit 588587a

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

Diff for: content/docs/addons-shallow-renderer.md

+12-12
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ import ShallowRenderer from 'react-test-renderer/shallow'; // ES6
1313
var ShallowRenderer = require('react-test-renderer/shallow'); // ES5 with npm
1414
```
1515

16-
## Overview {#overview}
16+
## ओवरव्यू {#overview}
1717

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.
18+
React के लिए यूनिट टेस्ट लिखते समय शैलो रेंडरिंग काफ़ी उपयोगी हो सकती है। शैलो रेंडरिंग आपको एक कौम्पोनॅन्ट को "एक स्तर गहरा" रेंडर करने देता है और रेंडर मेथड जो रिटर्न कर रहा है उसको अस्सर्ट कर सकते हैं कि इस कौम्पोनॅन्ट का रेंडर मेथड क्या return करेगा, child कौम्पोनॅन्टस के व्यव्हार की चिंता किये बिना, जो की instantiate या रेंडर नहीं होते। इसमें DOM की आवश्यकता नहीं होती है।
1919

20-
For example, if you have the following component:
20+
उदहारण के लिए, अगर आपके पास निम्नलिखित कौम्पोनॅन्ट है:
2121

2222
```javascript
2323
function MyComponent() {
@@ -30,7 +30,7 @@ function MyComponent() {
3030
}
3131
```
3232

33-
Then you can assert:
33+
तब आप अस्सर्ट कर सकते हैं:
3434

3535
```javascript
3636
import ShallowRenderer from 'react-test-renderer/shallow';
@@ -47,22 +47,22 @@ expect(result.props.children).toEqual([
4747
]);
4848
```
4949

50-
Shallow testing currently has some limitations, namely not supporting refs.
50+
वर्तमान में शैलो टेस्टिंग की कुछ सीमाएँ हैं, नामतः ये refs के साथ काम नहीं करता।
5151

52-
> Note:
52+
> टिप्पणी:
5353
>
54-
> We also recommend checking out Enzyme's [Shallow Rendering API](https://airbnb.io/enzyme/docs/api/shallow.html). It provides a nicer higher-level API over the same functionality.
54+
> हम Enzyme के [शैलो रेंडरिंग API](https://airbnb.io/enzyme/docs/api/shallow.html) का भी परीक्षण करने की भी सलाह देते हैं। यह उसी फंक्शनलिटी पर एक और अच्छे स्तर की API देता है।
5555
56-
## Reference {#reference}
56+
## संदर्भ {#reference}
5757

5858
### `shallowRenderer.render()` {#shallowrendererrender}
5959

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.
60+
आप जिस कौम्पोनॅन्ट का परीक्षण कर रहे हैं, shallowRenderer को आप उसे रेंडर करने के एक "स्थान" की तरह सोच सकते हैं, और इससे आप कौम्पोनॅन्ट के आउटपुट को निकाल सकते हैं।
6161

62-
`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 की आवश्यकता नहीं है और यह केवल एक स्तर गहराई तक ही रेंडर करता है। इसका मतलब आप कौम्पोनॅन्टस का परिक्षण उनके children के लागू होने के तरीके से अलग रखकर कर सकते हैं।
6363

6464
### `shallowRenderer.getRenderOutput()` {#shallowrenderergetrenderoutput}
6565

66-
After `shallowRenderer.render()` has been called, you can use `shallowRenderer.getRenderOutput()` to get the shallowly rendered output.
66+
`shallowRenderer.render()` के call हो जाने के बाद आप शैलो रेंडर हुए आउटपुट को पाने के लिए `shallowRenderer.getRenderOutput()` का इस्तेमाल कर सकते हैं।
6767

68-
You can then begin to assert facts about the output.
68+
तब आप आउटपुट के बारे में तथ्यों को अस्सर्ट करना शुरू कर सकते हैं।

0 commit comments

Comments
 (0)