chore: add test type declarations

This commit is contained in:
justsisyphus
2026-02-01 17:00:14 +09:00
parent 72a88068b9
commit 08c699dbc1

24
src/types/test-globals.d.ts vendored Normal file
View File

@@ -0,0 +1,24 @@
declare global {
const describe: (name: string, fn: () => void) => void
const test: (name: string, fn: () => void | Promise<void>) => void
const beforeEach: (fn: () => void | Promise<void>) => void
const afterEach: (fn: () => void | Promise<void>) => void
const expect: (value: unknown) => {
toBe: (expected: unknown) => void
toContain: (expected: unknown) => void
not: {
toBe: (expected: unknown) => void
toContain: (expected: unknown) => void
}
}
const spyOn: <T extends object, K extends keyof T>(
target: T,
key: K
) => {
mockReturnValue: (value: T[K]) => void
mockImplementation: (impl: T[K]) => void
mockRestore: () => void
}
}
export {}