Title: 유닛 테스트 추가 · Issue #2 · DaleStudy/github · GitHub
Open Graph Title: 유닛 테스트 추가 · Issue #2 · DaleStudy/github
X Title: 유닛 테스트 추가 · Issue #2 · DaleStudy/github
Description: 현재 상황 프로젝트에 유닛 테스트가 전혀 없습니다. 테스트 프레임워크 미설정 핵심 유틸리티 함수들의 동작 검증 불가 목표 utils/ 폴더의 핵심 유틸리티 함수에 대한 유닛 테스트 추가 테스트 파일은 애플리케이션 코드 옆에 배치 (예: github.js → github.test.js) 테스트 대상 utils/github.js createJWT() - JWT 생성 및 서명 importPrivateKey() - PKCS8 P...
Open Graph Description: 현재 상황 프로젝트에 유닛 테스트가 전혀 없습니다. 테스트 프레임워크 미설정 핵심 유틸리티 함수들의 동작 검증 불가 목표 utils/ 폴더의 핵심 유틸리티 함수에 대한 유닛 테스트 추가 테스트 파일은 애플리케이션 코드 옆에 배치 (예: github.js → github.test.js) 테스트 대상 utils/github.js createJWT() - ...
X Description: 현재 상황 프로젝트에 유닛 테스트가 전혀 없습니다. 테스트 프레임워크 미설정 핵심 유틸리티 함수들의 동작 검증 불가 목표 utils/ 폴더의 핵심 유틸리티 함수에 대한 유닛 테스트 추가 테스트 파일은 애플리케이션 코드 옆에 배치 (예: github.js → github.test.js) 테스트 대상 utils/github.js createJWT() - ...
Opengraph URL: https://github.com/DaleStudy/github/issues/2
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"유닛 테스트 추가","articleBody":"## 현재 상황\n\n프로젝트에 **유닛 테스트가 전혀 없습니다**.\n\n- 테스트 프레임워크 미설정\n- 핵심 유틸리티 함수들의 동작 검증 불가\n\n## 목표\n\n`utils/` 폴더의 핵심 유틸리티 함수에 대한 유닛 테스트 추가\n\n**테스트 파일은 애플리케이션 코드 옆에 배치** (예: `github.js` → `github.test.js`)\n\n## 테스트 대상\n\n### `utils/github.js`\n- [ ] `createJWT()` - JWT 생성 및 서명\n- [ ] `importPrivateKey()` - PKCS8 Private Key 파싱\n- [ ] `sign()` - RS256 서명 생성\n- [ ] `base64UrlEncode()` - Base64 URL 인코딩\n\n### `utils/cors.js`\n- [ ] `corsResponse()` - CORS 헤더 포함 응답\n- [ ] `errorResponse()` - 에러 응답 포맷\n\n## 파일 구조\n\n```\nutils/\n├── github.js\n├── github.test.js # 새로 추가\n├── cors.js\n├── cors.test.js # 새로 추가\n├── webhook.js\n└── ... (기타 파일들)\n```\n\n## 구현 가이드\n\n### 1. 테스트 프레임워크 설치\n\n```bash\nnpm install -D vitest\n```\n\n### 2. 설정 파일 생성\n\n`vitest.config.js`:\n```javascript\nimport { defineConfig } from 'vitest/config';\n\nexport default defineConfig({\n test: {\n globals: true,\n },\n});\n```\n\n### 3. package.json에 스크립트 추가\n\n```json\n{\n \"scripts\": {\n \"test\": \"vitest run\",\n \"test:watch\": \"vitest\"\n }\n}\n```\n\n### 4. 테스트 파일 작성 예시\n\n`utils/github.test.js`:\n```javascript\nimport { describe, it, expect } from 'vitest';\nimport { base64UrlEncode } from './github.js';\n\ndescribe('base64UrlEncode', () =\u003e {\n it('should encode Uint8Array to base64url', () =\u003e {\n const input = new Uint8Array([72, 101, 108, 108, 111]);\n const result = base64UrlEncode(input);\n \n expect(result).toBe('SGVsbG8');\n });\n});\n```\n\n`utils/cors.test.js`:\n```javascript\nimport { describe, it, expect } from 'vitest';\nimport { corsResponse, errorResponse } from './cors.js';\n\ndescribe('corsResponse', () =\u003e {\n it('should include CORS headers', () =\u003e {\n const response = corsResponse({ success: true });\n \n expect(response.headers.get('Access-Control-Allow-Origin')).toBe('*');\n });\n});\n\ndescribe('errorResponse', () =\u003e {\n it('should return error with status code', () =\u003e {\n const response = errorResponse('Not found', 404);\n \n expect(response.status).toBe(404);\n });\n});\n```\n\n## 체크리스트\n\n- [ ] Vitest 설치\n- [ ] `vitest.config.js` 생성\n- [ ] `package.json`에 test 스크립트 추가\n- [ ] `utils/github.test.js` 작성\n- [ ] `utils/cors.test.js` 작성\n- [ ] `npm test`로 모든 테스트 통과 확인\n\n## 참고\n\n- [Vitest 공식 문서](https://vitest.dev/)\n- [Cloudflare Workers 테스트](https://developers.cloudflare.com/workers/testing/vitest-integration/)\n","author":{"url":"https://github.com/DaleSeo","@type":"Person","name":"DaleSeo"},"datePublished":"2025-11-15T16:46:37.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/2/github/issues/2"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:37920c26-0348-1e88-00fc-ceace7471ff3 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A2D2:116AF0:4EE874:6D3E76:697215F6 |
| html-safe-nonce | bfb5310540a956698c5e346434ba2f0d3ae7f840d633e31f3c1b185406326907 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMkQyOjExNkFGMDo0RUU4NzQ6NkQzRTc2OjY5NzIxNUY2IiwidmlzaXRvcl9pZCI6IjEzODY5MTM5ODc1NDE3MzQ5MDIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | bf57c750f55ca1be8b7e3bfec2fc174d3e31ca7b9b57e3edd5c53985df7b907c |
| hovercard-subject-tag | issue:3628937461 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/DaleStudy/github/2/issue_layout |
| twitter:image | https://opengraph.githubassets.com/71fc5e8837b065e9ed2deb0b750871518e67d8d4188ab7e0335de58dd6121cdc/DaleStudy/github/issues/2 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/71fc5e8837b065e9ed2deb0b750871518e67d8d4188ab7e0335de58dd6121cdc/DaleStudy/github/issues/2 |
| og:image:alt | 현재 상황 프로젝트에 유닛 테스트가 전혀 없습니다. 테스트 프레임워크 미설정 핵심 유틸리티 함수들의 동작 검증 불가 목표 utils/ 폴더의 핵심 유틸리티 함수에 대한 유닛 테스트 추가 테스트 파일은 애플리케이션 코드 옆에 배치 (예: github.js → github.test.js) 테스트 대상 utils/github.js createJWT() - ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | DaleSeo |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7aea209b12f15b5742ac38170cf1d21874bf205eb5ad0cac666cd92599fc4cbc |
| turbo-cache-control | no-preview |
| go-import | github.com/DaleStudy/github git https://github.com/DaleStudy/github.git |
| octolytics-dimension-user_id | 103336331 |
| octolytics-dimension-user_login | DaleStudy |
| octolytics-dimension-repository_id | 1090658831 |
| octolytics-dimension-repository_nwo | DaleStudy/github |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1090658831 |
| octolytics-dimension-repository_network_root_nwo | DaleStudy/github |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 3ff289e97142545d3d22ade4ca0ecba5005b7322 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width