Skip to content

feat: jest Coverage에 대한 push 제한 처리 #25

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

Merged
merged 7 commits into from
Jun 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,
},
},
Comment on lines +18 to +24
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

한 수 배워갑니다!

};
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.

Loading