/** * Jest adapter for the native-boundary fake: * `@codemagic/react-native-patch/jest`. * * Installs a fake in place of the `NativeCodemagicPatch` TurboModule so the * real SDK loads under Jest and hydrates from a scenario you seed. * * Isolation contract: * - There is one current fake per test file (Jest gives each test file its * own environment). It lives on `globalThis`, so `jest.resetModules()` does * not drop it. * - `installPatchFake(seed)` replaces the current fake. An SDK instance that * was already imported keeps the native module it captured at import and the * state it hydrated, so install before importing the app graph, or call * `loadSdk()` after installing. * - `loadSdk()` runs `jest.resetModules()` and imports a fresh SDK, which * hydrates from the current fake. It clears every module, so SDK runtime * state goes with it; anything else that imports the SDK must be required * again after it. It does not reset the fake: failures, server answers and * packages downloaded so far stay. A new scenario means a new * `installPatchFake(seed)`. * - `loadSdk()` cancels the pending `ON_NEXT_SUSPEND` activation timer of the * SDK the previous `loadSdk()` imported, so it cannot reload the bundle * during a later scenario. An SDK imported without `loadSdk()` (install, * then a plain import) is not disposed this way. */ import type { PatchFake, PatchFakeSeed } from "./types"; export type { PatchFake, PatchFakeMethod, PatchFakeSeed, PatchFakeServer, PatchPackageSeed, } from "./types"; /** * Make `seed` the native state the SDK sees, replacing any earlier fake. Only * SDK instances imported after this call use it: call it before importing the * app graph, or follow it with `loadSdk()`. */ export declare function installPatchFake(seed?: PatchFakeSeed): PatchFake; /** * Reset Jest's module registry and import a fresh SDK, which hydrates from the * current fake. Modules that import the SDK must be required again after this * to share the fresh instance. */ export declare function loadSdk(): Promise; //# sourceMappingURL=jest.d.ts.map