From 6a28929497378f5089f626f54e259af8746c08c8 Mon Sep 17 00:00:00 2001 From: nrslib <38722970+nrslib@users.noreply.github.com> Date: Mon, 23 Feb 2026 14:34:20 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=80=9A=E7=9F=A5=E3=83=A6=E3=83=BC?= =?UTF-8?q?=E3=83=86=E3=82=A3=E3=83=AA=E3=83=86=E3=82=A3=E3=81=AE=E3=83=86?= =?UTF-8?q?=E3=82=B9=E3=83=88=E3=83=A2=E3=83=83=E3=82=AF=E8=BF=BD=E5=8A=A0?= =?UTF-8?q?=E3=81=A8=20check:release=20=E3=81=AE=E9=80=9A=E7=9F=A5?= =?UTF-8?q?=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 通知機能(notifySuccess/notifyError/playWarningSound)追加に伴い、 テストの vi.mock を修正。重複モックの統合、vitest 環境変数の追加、 GH API の recursive パラメータ修正、check:release に macOS 通知を追加。 --- e2e/specs/repertoire-real.e2e.ts | 2 +- package.json | 2 +- src/__tests__/it-config-provider-options.test.ts | 3 +++ src/__tests__/it-pipeline-modes.test.ts | 4 ---- src/__tests__/it-pipeline.test.ts | 4 ---- src/__tests__/pipelineExecution.test.ts | 3 +++ vitest.config.ts | 1 + 7 files changed, 9 insertions(+), 10 deletions(-) diff --git a/e2e/specs/repertoire-real.e2e.ts b/e2e/specs/repertoire-real.e2e.ts index 5ba95f1..e9d3001 100644 --- a/e2e/specs/repertoire-real.e2e.ts +++ b/e2e/specs/repertoire-real.e2e.ts @@ -40,7 +40,7 @@ function fixtureHasManifest(repo: string, ref: string, filename: string): boolea try { const out = execFileSync( 'gh', - ['api', `/repos/${repo}/git/trees/${ref}`, '--recursive'], + ['api', `/repos/${repo}/git/trees/${ref}?recursive=1`], { encoding: 'utf-8', stdio: 'pipe' }, ); const tree = JSON.parse(out) as { tree: { path: string }[] }; diff --git a/package.json b/package.json index b0cf1f1..fb9e53c 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "test:e2e:codex": "npm run test:e2e:provider:codex", "test:e2e:opencode": "npm run test:e2e:provider:opencode", "lint": "eslint src/", - "check:release": "npm run build && npm run lint && npm run test && npm run test:e2e", + "check:release": "npm run build && npm run lint && npm run test && npm run test:e2e; code=$?; if [ \"$code\" -eq 0 ]; then msg='check:release passed'; else msg=\"check:release failed (exit=$code)\"; fi; if command -v osascript >/dev/null 2>&1; then osascript -e \"display notification \\\"$msg\\\" with title \\\"takt\\\" subtitle \\\"Release Check\\\"\" >/dev/null 2>&1 || true; fi; echo \"[takt] $msg\"; exit $code", "prepublishOnly": "npm run lint && npm run build && npm run test" }, "keywords": [ diff --git a/src/__tests__/it-config-provider-options.test.ts b/src/__tests__/it-config-provider-options.test.ts index 5659f53..c714d8b 100644 --- a/src/__tests__/it-config-provider-options.test.ts +++ b/src/__tests__/it-config-provider-options.test.ts @@ -24,6 +24,9 @@ vi.mock('../core/piece/phase-runner.js', () => ({ vi.mock('../shared/utils/index.js', async (importOriginal) => ({ ...(await importOriginal>()), + notifySuccess: vi.fn(), + notifyError: vi.fn(), + playWarningSound: vi.fn(), generateReportDir: vi.fn().mockReturnValue('test-report-dir'), })); diff --git a/src/__tests__/it-pipeline-modes.test.ts b/src/__tests__/it-pipeline-modes.test.ts index b419cf6..810e47d 100644 --- a/src/__tests__/it-pipeline-modes.test.ts +++ b/src/__tests__/it-pipeline-modes.test.ts @@ -86,10 +86,6 @@ vi.mock('../shared/utils/index.js', async (importOriginal) => ({ ...(await importOriginal>()), notifySuccess: vi.fn(), notifyError: vi.fn(), -})); - -vi.mock('../shared/utils/index.js', async (importOriginal) => ({ - ...(await importOriginal>()), generateSessionId: vi.fn().mockReturnValue('test-session-id'), createSessionLog: vi.fn().mockReturnValue({ startTime: new Date().toISOString(), diff --git a/src/__tests__/it-pipeline.test.ts b/src/__tests__/it-pipeline.test.ts index 2410ec2..702d342 100644 --- a/src/__tests__/it-pipeline.test.ts +++ b/src/__tests__/it-pipeline.test.ts @@ -68,10 +68,6 @@ vi.mock('../shared/utils/index.js', async (importOriginal) => ({ ...(await importOriginal>()), notifySuccess: vi.fn(), notifyError: vi.fn(), -})); - -vi.mock('../shared/utils/index.js', async (importOriginal) => ({ - ...(await importOriginal>()), generateSessionId: vi.fn().mockReturnValue('test-session-id'), createSessionLog: vi.fn().mockReturnValue({ startTime: new Date().toISOString(), diff --git a/src/__tests__/pipelineExecution.test.ts b/src/__tests__/pipelineExecution.test.ts index 8f90869..1c2f099 100644 --- a/src/__tests__/pipelineExecution.test.ts +++ b/src/__tests__/pipelineExecution.test.ts @@ -68,6 +68,9 @@ vi.mock('../shared/utils/index.js', async (importOriginal) => ({ debug: vi.fn(), error: vi.fn(), }), + notifySuccess: vi.fn(), + notifyError: vi.fn(), + playWarningSound: vi.fn(), getSlackWebhookUrl: (...args: unknown[]) => mockGetSlackWebhookUrl(...args as []), sendSlackNotification: (...args: unknown[]) => mockSendSlackNotification(...(args as [string, string])), buildSlackRunSummary: (...args: unknown[]) => mockBuildSlackRunSummary(...(args as [unknown])), diff --git a/vitest.config.ts b/vitest.config.ts index 918e5bf..bc1916b 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -4,6 +4,7 @@ export default defineConfig({ test: { env: { TAKT_CONFIG_DIR: '', + TAKT_NOTIFY_WEBHOOK: '', }, include: ['src/__tests__/**/*.test.ts'], environment: 'node',