Choyeah Hwang
Choyeah Hwang
"2. 테스트 환경 구동하기" 항목에서 라이브러리 설치 안할경우 다음과 같은 에러가 출력됨. `Cannot find module '@testing-library/jest-dom/extend-expect' from 'setupTests.js'` 아래와 같이 라이브러 설치 후 해결됨. `> yarn add --dev @testing-library/jest-dom`
// 기존 .addWithJSX('로딩 메세지 예제', () => ( fetch('/').then(() => 'hello')} /> )); // 수정, isLoading 프로퍼티 추가 .addWithJSX('로딩 메세지 예제', () => ( fetch('/').then(() => 'hello')} /> ));
// 기존 ``` const formulaWithCompose = compose( multiplyTwo, multiplyThree, addFour ); const x = 10; fomulaWithCompose(10); ``` // 수정 ``` const formulaWithCompose = compose( multiplyTwo, multiplyThree, addFour ); const x...
// 기존 코드 ``` function compose(funcArr) { return funcArry.reduce( //
// 기존 코드 `const multiplyX = x => a => multiply(a, 2);` // 수정된 코드 `const multiplyX = x => a => multiply(a, x);`
// 기존 expect(changeStub).toHaveBeenCalledWith('required', true); input.simulate('click', { target: { checked: false } }); expect(changeStub).toHaveBeenCalledWith('required', false); // 수정 expect(changeStub).toHaveBeenCalledWith('test_name', true); //
* 207p 원본: > yarn test ./src/__tests__/03/Input_spec.jsx 수정본: > yarn test ./src/__tests__/04/Input_spec.jsx
오타: increateCount() 수정후: increaseCount()
//기존 `this.setState(count => {count: count + 1});` //수정 `this.setState(state => ({ count: state.count + 1 }));`
➜ projects create-react-app do-it-example Creating a new React app in /Users/xxx/projects/do-it-example. Installing packages. This might take a couple of minutes. Installing react, react-dom, and react-scripts with cra-template... yarn add v1.22.4...