import { Plugin } from "vite"; //#region src/jest-compat/transform.d.ts /** * Vite plugin that adapts a Jest suite's `jest.mock(...)` calls for Vitest: * * 1. **Hoisting** — rewrites the `jest` object of `jest.mock`/`unmock`/`doMock`/ * `doUnmock` to `vi`, so Vitest's hoister (which only recognises `vi`/`vitest`) * lifts them above the imports. Without this a top-level `jest.mock(...)` runs * after imports and silently doesn't apply. * * 2. **CJS interop** — wraps each `jest.mock`/`doMock` factory so its return value * passes through Jest's `_interopRequireDefault` semantics (see interop.mjs). * Jest treats the factory return as `module.exports`; Vitest treats it as an ES * namespace. This bridges the two common Jest shapes that otherwise break: * jest.mock('m', () => Component) // Vitest: "not returning an object" * jest.mock('m', () => ({ a, b })) // Vitest: default import is undefined * A factory already returning an ES shape (`__esModule`/explicit `default`) is * passed through unchanged. * * Opt-in: add after `reactNative()`; pair with `jestCompatSetup` + `globals: true`. */ declare function jestMockTransform(): Plugin; //#endregion //#region src/jest-compat/index.d.ts /** Setup-file specifier: gives the suite a `jest` global backed by Vitest's `vi`. */ declare const jestCompatSetup = "vitest-native/jest-compat/setup"; /** * `resolve.alias` entries that redirect Jest-only modules to Vitest-backed shims: * - `@jest/globals` → a shim re-exporting Vitest globals (unblocks RNTL < 12) * - `@testing-library/jest-native/extend-expect` → a no-op (matchers are already * registered by vitest-native's setup) * * Spread into your config's `resolve.alias`. */ declare function jestCompatAliases(): Record; //#endregion export { jestCompatAliases, jestCompatSetup, jestMockTransform };