fix(ci): simplify test runner to plain bun test by fixing mock.module() leakage

- Add afterAll(() => { mock.restore() }) to 52 test files missing cleanup
- Rewrite create-tool-guard-hooks.test.ts to use spyOn instead of barrel mock
- Fix skill-mcp-manager OAuth tests with missing mockTokens/mockLogin definitions
- Fix start-work hook: show worktree active block on resume with existing worktree_path
- Extract createWorktreeActiveBlock to worktree-block.ts to avoid circular import
- Replace 80-line isolated test runner CI config with single `bun test` command
This commit is contained in:
YeonGyu-Kim
2026-04-03 23:06:35 +09:00
parent 06180e09f8
commit 53eeac3f31
55 changed files with 219 additions and 190 deletions
+3 -1
View File
@@ -1,4 +1,4 @@
import { describe, test, expect, mock, beforeEach, spyOn } from 'bun:test'
import { describe, test, expect, mock, beforeEach, spyOn, afterAll } from 'bun:test'
import type { TmuxConfig } from '../../config/schema'
import type { WindowState, PaneAction } from './types'
import type { ActionResult, ExecuteContext } from './action-executor'
@@ -77,6 +77,8 @@ mock.module('./pane-state-querier', () => ({
: null,
}))
afterAll(() => { mock.restore() })
mock.module('./action-executor', () => ({
executeActions: mockExecuteActions,
executeAction: mockExecuteAction,
@@ -1,4 +1,4 @@
import { beforeEach, describe, expect, mock, test } from "bun:test"
import { beforeEach, describe, expect, mock, test, afterAll } from "bun:test"
import type { TmuxConfig } from "../../config/schema"
import type { ActionResult, ExecuteContext, ExecuteActionsResult } from "./action-executor"
import type { TmuxUtilDeps } from "./manager"
@@ -46,6 +46,8 @@ mock.module("../../shared/tmux", () => ({
SESSION_MISSING_GRACE_MS: 1_000,
}))
afterAll(() => { mock.restore() })
const mockTmuxDeps: TmuxUtilDeps = {
isInsideTmux: mockIsInsideTmux,
getCurrentPaneId: mockGetCurrentPaneId,