import { createTestSuite } from "./create-test-suite.mjs"; import { DBAdapter } from "@better-auth/core/db/adapter"; import { Awaitable, BetterAuthOptions } from "@better-auth/core"; //#region src/adapter/test-adapter.d.ts type Logger = { info: (...args: any[]) => void; success: (...args: any[]) => void; warn: (...args: any[]) => void; error: (...args: any[]) => void; debug: (...args: any[]) => void; }; declare const testAdapter: ({ adapter: getAdapter, runMigrations, overrideBetterAuthOptions, additionalCleanups, tests, prefixTests, onFinish, customIdGenerator, transformIdOutput }: { /** * A function that will return the adapter instance to test with. * * @example * ```ts * testAdapter({ * adapter: (options) => drizzleAdapter(drizzle(db), { * schema: generateSchema(options), * }), * }) */ adapter: (options: BetterAuthOptions) => Awaitable<(options: BetterAuthOptions) => DBAdapter>; /** * A function that will run the database migrations. */ runMigrations: (betterAuthOptions: BetterAuthOptions) => Promise | void; /** * Any potential better-auth options overrides. */ overrideBetterAuthOptions?: (betterAuthOptions: BetterAuthOptions) => BetterAuthOptions; /** * By default we will cleanup all tables automatically, * but if you have additional cleanup logic, you can pass it here. * * Such as deleting a DB file that could had been created. */ additionalCleanups?: () => Promise | void; /** * A test suite to run. */ tests: ReturnType>[]; /** * A prefix to add to the test suite name. */ prefixTests?: string; /** * Upon finish of the tests, this function will be called. */ onFinish?: () => Promise | void; /** * Custom ID generator function to be used by the helper functions. (such as `insertRandom`) */ customIdGenerator?: () => any; /** * A function that will transform the ID output. */ transformIdOutput?: (id: any) => any; }) => Promise<{ execute: () => void; }>; //#endregion export { Logger, testAdapter };