-
-
Notifications
You must be signed in to change notification settings - Fork 508
translating reference-test-renderer.md #190
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
Changes from 2 commits
a632685
24d7da3
4063d79
9f88ecd
5953197
183299d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -113,27 +113,28 @@ TestRenderer.create(element, options); | |
TestRenderer.act(callback); | ||
``` | ||
|
||
Similar to the [`act()` helper from `react-dom/test-utils`](/docs/test-utils.html#act), `TestRenderer.act` prepares a component for assertions. Use this version of `act()` to wrap calls to `TestRenderer.create` and `testRenderer.update`. | ||
react-dom/test-utils에 act()와 비슷하게, TestRenderer.act는 실행을 위한 컴포넌트들을 준비한다. | ||
TestRenderer.create 와 trestRenderer.update를 호출을 보호하기 위해 이 버전의 act()를 사용하십시오. | ||
|
||
```javascript | ||
import {create, act} from 'react-test-renderer'; | ||
import App from './app.js'; // The component being tested | ||
|
||
// render the component | ||
// 컴포넌트 랜더링하기 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 경어체로 문체를 변경해주세요 |
||
let root; | ||
act(() => { | ||
root = create(<App value={1}/>) | ||
}); | ||
|
||
// make assertions on root | ||
// root 검증하기 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 경어체로 문체를 변경해주세요 |
||
expect(root.toJSON()).toMatchSnapshot(); | ||
|
||
// update with some different props | ||
// 몇몇의 다른 프로퍼티즈들을 업데이트하기 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 경어체로 문체를 변경해주세요 |
||
act(() => { | ||
root = root.update(<App value={2}/>); | ||
}) | ||
|
||
// make assertions on root | ||
// root 검증하기 | ||
expect(root.toJSON()).toMatchSnapshot(); | ||
``` | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://ko.wikipedia.org/wiki/%EB%A7%88%ED%81%AC%EB%8B%A4%EC%9A%B4