test: run suite without split runner
This commit is contained in:
@@ -1,10 +1,13 @@
|
||||
/// <reference path="../../../bun-test.d.ts" />
|
||||
import { describe, test, expect, mock, beforeEach, spyOn, afterAll } from 'bun:test'
|
||||
import { describe, test, expect, mock, beforeEach, spyOn, afterAll, afterEach } from 'bun:test'
|
||||
import type { TmuxConfig } from '../../config/schema'
|
||||
import type { WindowState, PaneAction } from './types'
|
||||
import type { ActionResult, ExecuteContext } from './action-executor'
|
||||
import type { TmuxSessionManager as TmuxSessionManagerType, TmuxUtilDeps } from './manager'
|
||||
import * as sharedModule from '../../shared'
|
||||
import * as sharedTmuxOriginal from '../../shared/tmux'
|
||||
|
||||
const sharedTmuxSnapshot = { ...sharedTmuxOriginal }
|
||||
|
||||
type ExecuteActionsResult = {
|
||||
success: boolean
|
||||
@@ -131,6 +134,11 @@ function registerModuleMocks(): void {
|
||||
|
||||
afterAll(() => { mock.restore() })
|
||||
|
||||
afterEach(() => {
|
||||
mock.restore()
|
||||
mock.module('../../shared/tmux', () => sharedTmuxSnapshot)
|
||||
})
|
||||
|
||||
const trackedSessions = new Set<string>()
|
||||
const readySessions = new Set<string>()
|
||||
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
/// <reference path="../../../bun-test.d.ts" />
|
||||
import { beforeEach, describe, expect, mock, test, afterAll } from "bun:test"
|
||||
import { afterEach, 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"
|
||||
import type { TrackedSession, WindowState } from "./types"
|
||||
import * as sharedTmuxOriginal from "../../shared/tmux"
|
||||
|
||||
const sharedTmuxSnapshot = { ...sharedTmuxOriginal }
|
||||
|
||||
const mockQueryWindowState = mock<(paneId: string) => Promise<WindowState | null>>(async () => ({
|
||||
windowWidth: 220,
|
||||
@@ -53,6 +56,11 @@ function registerModuleMocks(): void {
|
||||
|
||||
afterAll(() => { mock.restore() })
|
||||
|
||||
afterEach(() => {
|
||||
mock.restore()
|
||||
mock.module("../../shared/tmux", () => sharedTmuxSnapshot)
|
||||
})
|
||||
|
||||
const mockTmuxDeps: TmuxUtilDeps = {
|
||||
isInsideTmux: mockIsInsideTmux,
|
||||
getCurrentPaneId: mockGetCurrentPaneId,
|
||||
|
||||
Reference in New Issue
Block a user