diff --git a/.github/workflows/pr-test-validation.yml b/.github/workflows/pr-test-validation.yml new file mode 100644 index 0000000..48ce65c --- /dev/null +++ b/.github/workflows/pr-test-validation.yml @@ -0,0 +1,29 @@ +name: PR Test Validation + +on: + pull_request: + types: [ opened, synchronize, reopened ] + branches: [ '*' ] + +env: + NODE_VERSION: '22' + +jobs: + test: + name: Run Unit Tests + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: ${{ env.NODE_VERSION }} + + - name: Install dependencies + run: npm ci + + - name: Run tests + run: npm test \ No newline at end of file diff --git a/tests/utils/DateUtils.test.ts b/tests/utils/DateUtils.test.ts index 07899ed..a711cc3 100644 --- a/tests/utils/DateUtils.test.ts +++ b/tests/utils/DateUtils.test.ts @@ -3,15 +3,12 @@ import { getKoreaTimeISO, parseDate, isEqualOrAfterDateOnly } from '../../src/ut describe('DateUtils', () => { describe('getKoreaTimeISO', () => { it('ISO 형식과 한국 시간대 확인', () => { + //given const result = getKoreaTimeISO(); + //when then // ISO 형식 검증 (YYYY-MM-DDTHH:mm:ss+09:00) expect(result).toMatch(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\+09:00$/); - - // 한국 시간대 검증 - const date = new Date(result); - const koreaOffset = date.getTimezoneOffset(); - expect(koreaOffset).toBe(-540); // UTC+9 (9 * 60 = 540 minutes) }); });