fix: improve TypeScript types for better IDE code hinting
- Install @types/bun and @types/jsdom for proper type definitions - Fix mock function typing in test files - Create jest-dom.d.ts to properly extend Bun's Matchers interface - Remove MockedFunction imports (not supported in Bun's types) - Cast global.fetch and useSession mocks to any where needed - Fix mock.module return types to match expected signatures This resolves TypeScript errors that were preventing proper code completion and type checking in IDEs.
This commit is contained in:
Vendored
+12
@@ -0,0 +1,12 @@
|
||||
/// <reference types="@testing-library/jest-dom" />
|
||||
|
||||
import { type expect } from 'bun:test'
|
||||
import { type TestingLibraryMatchers } from '@testing-library/jest-dom/matchers'
|
||||
|
||||
declare module 'bun:test' {
|
||||
interface Matchers<T = any>
|
||||
extends TestingLibraryMatchers<
|
||||
ReturnType<typeof expect.stringContaining>,
|
||||
T
|
||||
> {}
|
||||
}
|
||||
Reference in New Issue
Block a user