From f6d4201d7d4c56f05ac47ecd6ae5ab2f429f59af Mon Sep 17 00:00:00 2001 From: justsisyphus Date: Sat, 17 Jan 2026 16:47:56 +0900 Subject: [PATCH] fix(test): add nested beforeEach for mainSessionID test isolation Previous test was setting mainSessionID to 'main-session-123' and the next test expected undefined. The outer beforeEach wasn't properly resetting state between tests in the nested describe block. Adding a nested beforeEach ensures proper test isolation. --- script/publish.ts | 11 +++++++++-- src/features/claude-code-session-state/state.test.ts | 5 +++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/script/publish.ts b/script/publish.ts index 64a7a787..f082457e 100644 --- a/script/publish.ts +++ b/script/publish.ts @@ -232,10 +232,17 @@ async function publishAllPackages(version: string): Promise { } async function buildPackages(): Promise { + const skipPlatform = process.env.SKIP_PLATFORM_PACKAGES === "true" + console.log("\nBuilding packages...") await $`bun run clean && bun run build` - console.log("Building platform binaries...") - await $`bun run build:binaries` + + if (skipPlatform) { + console.log("⏭️ Skipping platform binaries (SKIP_PLATFORM_PACKAGES=true)") + } else { + console.log("Building platform binaries...") + await $`bun run build:binaries` + } } async function gitTagAndRelease(newVersion: string, notes: string[]): Promise { diff --git a/src/features/claude-code-session-state/state.test.ts b/src/features/claude-code-session-state/state.test.ts index 7b72ebf0..813bc197 100644 --- a/src/features/claude-code-session-state/state.test.ts +++ b/src/features/claude-code-session-state/state.test.ts @@ -82,6 +82,11 @@ describe("claude-code-session-state", () => { }) describe("mainSessionID", () => { + beforeEach(() => { + // #given - ensure clean state for mainSessionID tests + setMainSession(undefined) + }) + test("should store and retrieve main session ID", () => { // #given const mainID = "main-session-123"