mirror of
https://github.com/better-auth/better-auth.git
synced 2026-10-19 23:53:17 -05:00
40 lines
927 B
TypeScript
40 lines
927 B
TypeScript
import { memoryAdapter } from "@better-auth/memory-adapter";
|
|
import { testAdapter } from "@better-auth/test-utils/adapter";
|
|
import { getAuthTables } from "better-auth/db";
|
|
import {
|
|
authFlowTestSuite,
|
|
joinsTestSuite,
|
|
normalTestSuite,
|
|
numberIdTestSuite,
|
|
transactionsTestSuite,
|
|
uuidTestSuite,
|
|
} from "../adapter-factory";
|
|
|
|
let db: Record<string, any[]> = {};
|
|
|
|
const { execute } = await testAdapter({
|
|
adapter: () => {
|
|
return memoryAdapter(db);
|
|
},
|
|
runMigrations: (options) => {
|
|
db = {};
|
|
const authTables = getAuthTables(options);
|
|
const allModels = Object.keys(authTables);
|
|
for (const model of allModels) {
|
|
const modelName = authTables[model]?.modelName || model;
|
|
db[modelName] = [];
|
|
}
|
|
},
|
|
tests: [
|
|
normalTestSuite(),
|
|
transactionsTestSuite({ disableTests: { ALL: true } }),
|
|
authFlowTestSuite(),
|
|
numberIdTestSuite(),
|
|
joinsTestSuite(),
|
|
uuidTestSuite(),
|
|
],
|
|
async onFinish() {},
|
|
});
|
|
|
|
execute();
|