Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions content/docs/reference-test-renderer.md
Original file line number Diff line number Diff line change
Expand Up @@ -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()를 사용하십시오.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • 번역해주신 116행과 117행은 원문에서 한 라인에 작성된 문장들입니다. 포멧을 맞춰주시면 감사하겠습니다.
  • 경어체로 문체를 변경해주세요
  • markdown 링크와 code highlighting이 누락되었습니다. 아래 문서를 참고하셔서 누락된 markdown문법들을 추가해주세요

https://ko.wikipedia.org/wiki/%EB%A7%88%ED%81%AC%EB%8B%A4%EC%9A%B4


```javascript
import {create, act} from 'react-test-renderer';
import App from './app.js'; // The component being tested

// render the component
// 컴포넌트 랜더링하기
Copy link
Member

Choose a reason for hiding this comment

The 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 검증하기
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

경어체로 문체를 변경해주세요

expect(root.toJSON()).toMatchSnapshot();

// update with some different props
// 몇몇의 다른 프로퍼티즈들을 업데이트하기
Copy link
Member

Choose a reason for hiding this comment

The 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();
```

Expand Down