Skip to content
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

[HW3] coverage 평가 범위 #130

Open
cheezafizz opened this issue Oct 11, 2020 · 3 comments
Open

[HW3] coverage 평가 범위 #130

cheezafizz opened this issue Oct 11, 2020 · 3 comments
Labels
HW3 question Further information is requested resolved

Comments

@cheezafizz
Copy link

cheezafizz commented Oct 11, 2020

serviceWorker.js나 index.js나 App.js의 coverage도 평가시 전체 coverage에 들어가는지 궁금합니다

@cheezafizz cheezafizz changed the title [HW3] serviceWorker.js [HW3] coverage 평가 범위 Oct 11, 2020
@hy00nc
Copy link
Member

hy00nc commented Oct 11, 2020

serviceWorker.js와 index.js는 포함하지 않습니다. App.js는 포함합니다.
실습 슬라이드에 나와있는 것처럼 package.json에 아래의 코드를 추가하시면 됩니다:

"jest": {
     collectCoverageFrom : [
       "src/**/*.{js,jsx}" ,
       "!src/index.js" ,
       "!src/serviceWorker.js"
] }

@hy00nc hy00nc added HW3 question Further information is requested labels Oct 11, 2020
@cheezafizz
Copy link
Author

감사합니다!

@jaewooklee93
Copy link

저만의 문제인지는 모르겠지만 yarn test --coverage라고 하면 collectCoverageFrom 기능이 잘 작동하지 않는 문제가 있었습니다.

yarn test --coverage --watchAll=false 라고 하면 제대로 작동하지만 대신에 save할때마다 auto reload 하는 기능이 되지가 않고요.

yarn test --coverage --watchAll 이라고 하니 auto reload도 되고 coverage도 정상적으로 되는 것을 확인할 수 있었습니다.

jestjs/jest#7331 를 보면 동일한 이슈를 겪는 사람들이 많이 있는 것 같은데요. 혹시 비슷하게 어려움 겪으시는 분들을 위해 여기 적어둡니다

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
HW3 question Further information is requested resolved
Projects
None yet
Development

No branches or pull requests

4 participants