test(tmux): add isolation regression coverage
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
Vendored
+16
-8
@@ -1,14 +1,19 @@
|
||||
declare module "bun:test" {
|
||||
type AnyFunction = (...args: any[]) => any
|
||||
|
||||
interface MockMetadata<TArgs extends unknown[]> {
|
||||
calls: TArgs[]
|
||||
}
|
||||
|
||||
interface MockFunction<TArgs extends unknown[] = unknown[], TReturn = unknown> {
|
||||
(...args: TArgs): TReturn
|
||||
mock: MockMetadata<TArgs>
|
||||
interface MockFunction<TFunction extends AnyFunction = AnyFunction> {
|
||||
(...args: Parameters<TFunction>): ReturnType<TFunction>
|
||||
mock: MockMetadata<Parameters<TFunction>>
|
||||
mockClear(): void
|
||||
mockReset(): void
|
||||
mockReturnValue(value: TReturn): void
|
||||
mockResolvedValue(value: Awaited<TReturn>): void
|
||||
mockRestore(): void
|
||||
mockReturnValue(value: ReturnType<TFunction>): void
|
||||
mockResolvedValue(value: Awaited<ReturnType<TFunction>>): void
|
||||
mockImplementation(fn: TFunction): MockFunction<TFunction>
|
||||
}
|
||||
|
||||
export function describe(name: string, fn: () => void): void
|
||||
@@ -18,9 +23,12 @@ declare module "bun:test" {
|
||||
export function afterEach(fn: () => void | Promise<void>): void
|
||||
export function beforeAll(fn: () => void | Promise<void>): void
|
||||
export function afterAll(fn: () => void | Promise<void>): void
|
||||
export function mock<TArgs extends unknown[], TReturn>(
|
||||
fn: (...args: TArgs) => TReturn,
|
||||
): MockFunction<TArgs, TReturn>
|
||||
export function mock<TFunction extends AnyFunction>(fn: TFunction): MockFunction<TFunction>
|
||||
|
||||
export function spyOn<TObject extends object>(
|
||||
object: TObject,
|
||||
key: keyof TObject,
|
||||
): MockFunction<AnyFunction>
|
||||
|
||||
export namespace mock {
|
||||
function module(modulePath: string, factory: () => Record<string, unknown>): void
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user