declare module "bun:test" { type AnyFunction = (...args: any[]) => any interface MockMetadata { calls: TArgs[] } interface MockFunction { (...args: Parameters): ReturnType mock: MockMetadata> mockClear(): void mockReset(): void mockRestore(): void mockReturnValue(value: ReturnType): void mockResolvedValue(value: Awaited>): void mockImplementation(fn: TFunction): MockFunction } export function describe(name: string, fn: () => void): void export function test(name: string, fn: () => void | Promise): void export function it(name: string, fn: () => void | Promise): void export function beforeEach(fn: () => void | Promise): void export function afterEach(fn: () => void | Promise): void export function beforeAll(fn: () => void | Promise): void export function afterAll(fn: () => void | Promise): void export function mock(fn: TFunction): MockFunction export function spyOn( object: TObject, key: keyof TObject, ): MockFunction export namespace mock { function module(modulePath: string, factory: () => Record): void function restore(): void } interface Matchers { toBe(expected: unknown): void toBeDefined(): void toBeUndefined(): void toBeNull(): void toEqual(expected: unknown): void toContain(expected: unknown): void toMatch(expected: RegExp | string): void toHaveLength(expected: number): void toHaveBeenCalled(): void toHaveBeenCalledTimes(expected: number): void toHaveBeenCalledWith(...expected: unknown[]): void toBeGreaterThan(expected: number): void toThrow(expected?: RegExp | string): void toStartWith(expected: string): void not: Matchers } export function expect(received: unknown): Matchers }