Skip to content

Commit

Permalink
merge: jest Coverage에 대한 push 제한 처리 (#25)
Browse files Browse the repository at this point in the history
* test: jest coverage threshold 지정

* config: husky pre-push 추가

* config: jest coverage 수집 대상 변경

* config: coverage threshold 변경

* chore: useScrollRatio 임시삭제

* fix: jest threshold 수집 범위 수정하여 파일 매치 문제 해결

* docs: contributing 문서에 테스트코드 정책 추가
  • Loading branch information
d0422 authored Jun 22, 2024
1 parent 551b252 commit 8bebdb2
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 34 deletions.
16 changes: 14 additions & 2 deletions .github/CONTRIBUTING.ko.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,23 @@
커뮤니티의 모든 분들의 Contribution을 환영합니다.
[영어](https://github.com/Rapiders/react-hooks/tree/main/.github/CONTRIBUTING.md)와 한국어 중 편한 언어를 사용하면 됩니다.

## 테스트 코드 정책

라이브러리의 품질을 보증하기위해 다음의 정책이 적용됩니다.
하나의 기능에 대해

1. branches의 coverage는 80%를 넘어야합니다. (추후 개선 100%로 변경예정)
2. functions의 coverage는 80%를 넘어야합니다. (추후 개선 100%로 변경예정)
3. lines는 반드시 100%여야합니다.

해당 정책을 만족하지 못하는 경우 `git push`가 이뤄지지 않습니다.

## Fork

1. 기여하고 싶은 경우 우선 이 레포지토리를 fork 합니다.
2. 작업이 완료되었다면 main 브랜치로 PR을 오픈합니다.
3. merge 되기 위해서는 반드시 maintainer 중 한 명이 이상의 approve를 받아야 합니다.
2. npm install을 진행합니다.
3. 작업이 완료되었다면 main 브랜치로 PR을 오픈합니다.
4. merge 되기 위해서는 반드시 maintainer 중 한 명이 이상의 approve를 받아야 합니다.

## Issue

Expand Down
15 changes: 13 additions & 2 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,22 @@
We welcome contribution from everyone in the community.
you can use English and [Korean](https://github.com/Rapiders/react-hooks/tree/main/.github/CONTRIBUTING.ko.md)

## Test Code Policy

To ensure the quality of the library, the following policy is applied for each feature:

1. Branch coverage must exceed 80%.
2. Function coverage must exceed 80%.
3. Line coverage must be 100%.

If these requirements are not met, `git push` will not be allowed.

## Fork

1. If you wish to contribute, first fork this repository.
2. Once your work is complete, open a PR to the main branch.
3. To be merged, it must receive at least one approval from a maintainer.
2. npm install
3. Once your work is complete, open a PR to the main branch.
4. To be merged, it must receive at least one approval from a maintainer.

## Issue

Expand Down
1 change: 1 addition & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npm run test:coverage
7 changes: 7 additions & 0 deletions jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,11 @@ module.exports = {
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths, {
prefix: '<rootDir>',
}),
coverageThreshold: {
'src/**/*.{ts,tsx}': {
branches: 80,
functions: 80,
lines: 100,
},
},
};
2 changes: 0 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import useAnimation from './useAnimation/useAnimation';
import useFocusAnimation from './useFocusAnimation/useFocusAnimation';
import useDragIndexCarousel from './useDragIndexCarousel/useDragIndexCarousel';
import useCarousel from './useCarousel/useCarousel';
import useScrollRatio from './useScrollRatio';
import useInterval from './useInterval/useInterval';
import useAfterMountEffect from './useAfterMountEffect/useAfterMountEffect';
import useRadio from './useRadio/useRadio';
Expand All @@ -19,7 +18,6 @@ export {
useFocusAnimation,
useDragIndexCarousel,
useCarousel,
useScrollRatio,
useInterval,
useAfterMountEffect,
useRadio,
Expand Down
28 changes: 0 additions & 28 deletions src/useScrollRatio.ts

This file was deleted.

0 comments on commit 8bebdb2

Please sign in to comment.