Files
new-api-analytics/bun-test.d.ts

21 lines
693 B
TypeScript

declare module "bun:test" {
export const beforeEach: (fn: () => void | Promise<void>) => void;
export const describe: (name: string, fn: () => void) => void;
export const expect: (value: unknown) => {
toBe: (expected: unknown) => void;
toBeNull: () => void;
toContain: (expected: unknown) => void;
toEqual: (expected: unknown) => void;
};
export const mock: {
<T extends (...args: never[]) => unknown>(fn: T): T & {
mock: {
calls: unknown[][];
};
mockClear: () => void;
};
module: (path: string, factory: () => Record<string, unknown>) => void;
};
export const test: (name: string, fn: () => void | Promise<void>) => void;
}