-
Notifications
You must be signed in to change notification settings - Fork 10
feat: index.ts test
#385
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
base: main
Are you sure you want to change the base?
feat: index.ts test
#385
Conversation
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Summary of ChangesHello @noahchoii, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a crucial test to the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
안녕하세요. index.ts의 엔트리포인트가 모든 컴포넌트를 export하는지 확인하는 테스트를 추가해주셔서 감사합니다. 이는 라이브러리의 일관성을 유지하는 데 중요한 역할을 합니다.
리뷰 결과, 테스트 코드 자체에 몇 가지 개선점을 발견했습니다.
- 테스트가 의도한 대로 동작하도록 패턴 매칭 로직을 수정해야 합니다. (critical)
- 불필요한
async키워드를 제거하여 코드 가독성을 높일 수 있습니다. (medium)
자세한 내용은 각 파일의 인라인 코멘트를 참고해주세요.
packages/core/src/index.test.ts
Outdated
| const exportPattern = `export * from './components/${folder}'`; | ||
| if (!indexContent.includes(exportPattern)) { | ||
| missingExports.push(folder); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
현재 테스트 로직은 index.ts의 export 구문에 포함된 세미콜론(;)을 확인하지 않아, 모든 컴포넌트에 대해 테스트가 실패하게 됩니다.1
또한, 문자열을 직접 비교하는 방식은 공백이나 따옴표 종류 등 예상치 못한 코드 스타일 변화에 취약할 수 있습니다. 더 안정적인 테스트를 위해 정규식을 사용하여 export 구문을 확인하는 것을 제안합니다. 이렇게 하면 세미콜론 누락 문제를 해결하고 테스트의 안정성을 높일 수 있습니다.
| const exportPattern = `export * from './components/${folder}'`; | |
| if (!indexContent.includes(exportPattern)) { | |
| missingExports.push(folder); | |
| } | |
| const exportPattern = new RegExp(`export \* from '\./components/${folder}';`); | |
| if (!exportPattern.test(indexContent)) { | |
| missingExports.push(folder); | |
| } |
Style Guide References
Footnotes
-
스타일 가이드에 따라 문장 끝에는 항상 세미콜론을 사용해야 합니다. 현재 프로젝트의
index.ts파일도 이 규칙을 따르고 있으므로, 테스트에서도 세미콜론을 포함하여 검증해야 합니다. ↩
packages/core/src/index.test.ts
Outdated
| import path from 'path'; | ||
|
|
||
| describe('@vapor-ui/core', () => { | ||
| it('should export all components from the components directory', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
✅ All tests passed!
Click here if you need to update snapshots. |
Description of Changes
Checklist
Before submitting the PR, please make sure you have checked all of the following items.