Skip to content

Commit

Permalink
Merge pull request Febase#107 from wooooooood/refactor
Browse files Browse the repository at this point in the history
refactor. indent
  • Loading branch information
wooooooood authored Apr 5, 2021
2 parents 1cac031 + ec2bd41 commit dc5093c
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions S2_Round2/jsTDD.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,19 +78,19 @@ TDD 프로세스

```jsx
"scripts": {
"test": "jest"
"test": "jest"
},
```

1. 테스트를 진행할 파일 `unit.test.js`를 생성한다.
- `.test.js` suffix를 사용해야 한다.
```jsx
const add = (a, b) => {
return 1;
return 1;
};
test('solution', () => {
expect(add(1, 1)).toBe(2);
expect(add(1, 1)).toBe(2);
});
```
- 영어 문법과 비슷: expect ~ toBe (보통 value) / expect ~ toEqual (array 등의 object)
Expand All @@ -102,14 +102,14 @@ test('solution', () => {
3. 성공하는 테스트 코드를 작성한다. (Green)
```jsx
const add = (a, b) => {
const num1 = a;
const num2 = b;
const num1 = a;
const num2 = b;
return num1 + num2;
return num1 + num2;
};
test('solution', () => {
expect(add(1, 1)).toBe(2);
expect(add(1, 1)).toBe(2);
});
```

Expand All @@ -118,11 +118,11 @@ test('solution', () => {
4. 성공 확인 후 리팩토링한다. (Refactor)
```jsx
const add = (a, b) => {
return a+b;
return a+b;
};
test('solution', () => {
expect(add(1, 1)).toBe(2);
expect(add(1, 1)).toBe(2);
});
```

Expand Down

0 comments on commit dc5093c

Please sign in to comment.