Thief of Wealth

jest에는 테스트용으로 만들어진 다양한 메서드들이 있다.

그것을 잘알고 적절하게 사용하는 것도 능력인것 같다.

 

 

localStorage는 Storage 객체로부터 메서드를 상속받기 때문에 __proto__로 접근하여 메서드를 모킹해주어야 하고,

throttling같이 시간차로 동작하는 유틸라이브러리는 jest.advanceTimersByTime 메서드를 통해서 가짜로 시간이 흐르게할 수 있다.

 

 

 

https://github.com/woowacourse-teams/2021-darass/commit/38e1bd2866f6edbf270c1011fa85e2d561ebc9c5

 

test: localStorage test 코드 작성 · woowacourse-teams/2021-darass@38e1bd2

Permalink This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. Browse files test: localStorage test 코드 작성 Loading branch information Showing 1 changed file with 26 additions and 0 deletio

github.com

https://github.com/woowacourse-teams/2021-darass/commit/0987b22ca7353d19bb5564ecc7ac524327d997e4

 

test: throttle test 코드 작성 · woowacourse-teams/2021-darass@0987b22

Permalink This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. Browse files test: throttle test 코드 작성 Loading branch information Showing 2 changed files with 25 additions and 0 deletions.

github.com

 

profile on loading

Loading...