@better-auth/test-utils 1.5.6 → 1.6.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapter.d.mts +2 -1
- package/dist/adapter.mjs +2 -3
- package/dist/create-test-suite.d.mts +1 -2
- package/dist/create-test-suite.mjs +0 -3
- package/dist/suites/auth-flow.d.mts +1 -2
- package/dist/suites/auth-flow.mjs +21 -26
- package/dist/suites/basic.d.mts +7 -4
- package/dist/suites/basic.mjs +182 -3
- package/dist/suites/case-insensitive.d.mts +27 -0
- package/dist/suites/case-insensitive.mjs +297 -0
- package/dist/suites/index.d.mts +1 -0
- package/dist/suites/joins.d.mts +2 -3
- package/dist/suites/joins.mjs +0 -3
- package/dist/suites/number-id.d.mts +2 -3
- package/dist/suites/number-id.mjs +0 -3
- package/dist/suites/transactions.d.mts +1 -2
- package/dist/suites/transactions.mjs +0 -3
- package/dist/suites/uuid.d.mts +2 -3
- package/dist/suites/uuid.mjs +0 -3
- package/dist/test-adapter.d.mts +1 -2
- package/dist/test-adapter.mjs +0 -3
- package/package.json +7 -6
- package/dist/create-test-suite.mjs.map +0 -1
- package/dist/suites/auth-flow.mjs.map +0 -1
- package/dist/suites/basic.mjs.map +0 -1
- package/dist/suites/index.mjs +0 -8
- package/dist/suites/joins.mjs.map +0 -1
- package/dist/suites/number-id.mjs.map +0 -1
- package/dist/suites/transactions.mjs.map +0 -1
- package/dist/suites/uuid.mjs.map +0 -1
- package/dist/test-adapter.mjs.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"test-adapter.mjs","names":[],"sources":["../src/adapter/test-adapter.ts"],"sourcesContent":["import type { Awaitable, BetterAuthOptions } from \"@better-auth/core\";\nimport type { DBAdapter } from \"@better-auth/core/db/adapter\";\nimport { deepmerge, initGetModelName } from \"@better-auth/core/db/adapter\";\nimport { TTY_COLORS } from \"@better-auth/core/env\";\nimport { getAuthTables } from \"better-auth/db\";\nimport { afterAll, beforeAll, describe } from \"vitest\";\nimport type { createTestSuite, TestSuiteStats } from \"./create-test-suite\";\n\nexport type Logger = {\n\tinfo: (...args: any[]) => void;\n\tsuccess: (...args: any[]) => void;\n\twarn: (...args: any[]) => void;\n\terror: (...args: any[]) => void;\n\tdebug: (...args: any[]) => void;\n};\n\nexport const testAdapter = async ({\n\tadapter: getAdapter,\n\trunMigrations,\n\toverrideBetterAuthOptions,\n\tadditionalCleanups,\n\ttests,\n\tprefixTests,\n\tonFinish,\n\tcustomIdGenerator,\n\ttransformIdOutput,\n}: {\n\t/**\n\t * A function that will return the adapter instance to test with.\n\t *\n\t * @example\n\t * ```ts\n\t * testAdapter({\n\t * adapter: (options) => drizzleAdapter(drizzle(db), {\n\t * schema: generateSchema(options),\n\t * }),\n\t * })\n\t */\n\tadapter: (\n\t\toptions: BetterAuthOptions,\n\t) => Awaitable<(options: BetterAuthOptions) => DBAdapter<BetterAuthOptions>>;\n\t/**\n\t * A function that will run the database migrations.\n\t */\n\trunMigrations: (betterAuthOptions: BetterAuthOptions) => Promise<void> | void;\n\t/**\n\t * Any potential better-auth options overrides.\n\t */\n\toverrideBetterAuthOptions?: (\n\t\tbetterAuthOptions: BetterAuthOptions,\n\t) => BetterAuthOptions;\n\t/**\n\t * By default we will cleanup all tables automatically,\n\t * but if you have additional cleanup logic, you can pass it here.\n\t *\n\t * Such as deleting a DB file that could had been created.\n\t */\n\tadditionalCleanups?: () => Promise<void> | void;\n\t/**\n\t * A test suite to run.\n\t */\n\ttests: ReturnType<ReturnType<typeof createTestSuite>>[];\n\t/**\n\t * A prefix to add to the test suite name.\n\t */\n\tprefixTests?: string;\n\t/**\n\t * Upon finish of the tests, this function will be called.\n\t */\n\tonFinish?: () => Promise<void> | void;\n\t/**\n\t * Custom ID generator function to be used by the helper functions. (such as `insertRandom`)\n\t */\n\tcustomIdGenerator?: () => any;\n\t/**\n\t * A function that will transform the ID output.\n\t */\n\ttransformIdOutput?: (id: any) => any;\n}) => {\n\tconst defaultBAOptions = {} satisfies BetterAuthOptions;\n\tlet betterAuthOptions = (() => {\n\t\treturn {\n\t\t\t...defaultBAOptions,\n\t\t\t...(overrideBetterAuthOptions?.(defaultBAOptions) || {}),\n\t\t} satisfies BetterAuthOptions;\n\t})();\n\n\tlet adapter: DBAdapter<BetterAuthOptions> = (\n\t\tawait getAdapter(betterAuthOptions)\n\t)(betterAuthOptions);\n\n\tconst adapterName = adapter.options?.adapterConfig.adapterName;\n\tconst adapterId = adapter.options?.adapterConfig.adapterId || adapter.id;\n\tconst adapterDisplayName = adapterName || adapterId;\n\n\tconst refreshAdapter = async (betterAuthOptions: BetterAuthOptions) => {\n\t\tadapter = (await getAdapter(betterAuthOptions))(betterAuthOptions);\n\t};\n\n\t/**\n\t * A helper function to log to the console.\n\t */\n\tconst log: Logger = (() => {\n\t\treturn {\n\t\t\tinfo: (...args: any[]) =>\n\t\t\t\tconsole.log(\n\t\t\t\t\t`${TTY_COLORS.fg.blue}INFO ${TTY_COLORS.reset} [${adapterDisplayName}]`,\n\t\t\t\t\t...args,\n\t\t\t\t),\n\t\t\tsuccess: (...args: any[]) =>\n\t\t\t\tconsole.log(\n\t\t\t\t\t`${TTY_COLORS.fg.green}SUCCESS${TTY_COLORS.reset} [${adapterDisplayName}]`,\n\t\t\t\t\t...args,\n\t\t\t\t),\n\t\t\twarn: (...args: any[]) =>\n\t\t\t\tconsole.log(\n\t\t\t\t\t`${TTY_COLORS.fg.yellow}WARN ${TTY_COLORS.reset} [${adapterDisplayName}]`,\n\t\t\t\t\t...args,\n\t\t\t\t),\n\t\t\terror: (...args: any[]) =>\n\t\t\t\tconsole.log(\n\t\t\t\t\t`${TTY_COLORS.fg.red}ERROR ${TTY_COLORS.reset} [${adapterDisplayName}]`,\n\t\t\t\t\t...args,\n\t\t\t\t),\n\t\t\tdebug: (...args: any[]) =>\n\t\t\t\tconsole.log(\n\t\t\t\t\t`${TTY_COLORS.fg.magenta}DEBUG ${TTY_COLORS.reset} [${adapterDisplayName}]`,\n\t\t\t\t\t...args,\n\t\t\t\t),\n\t\t};\n\t})();\n\n\t/**\n\t * Cleanup function to remove all rows from the database.\n\t */\n\tconst cleanup = async () => {\n\t\tconst start = performance.now();\n\t\tawait refreshAdapter(betterAuthOptions);\n\t\tconst getAllModels = getAuthTables(betterAuthOptions);\n\n\t\t// Clean up all rows from all models\n\t\tfor (const model of Object.keys(getAllModels)) {\n\t\t\tconst getModelName = initGetModelName({\n\t\t\t\tusePlural: adapter.options?.adapterConfig?.usePlural,\n\t\t\t\tschema: getAllModels,\n\t\t\t});\n\t\t\ttry {\n\t\t\t\tconst modelName = getModelName(model);\n\t\t\t\tawait adapter.deleteMany({ model: modelName, where: [] });\n\t\t\t} catch (error) {\n\t\t\t\tconst msg = `Error while cleaning up all rows from ${model}`;\n\t\t\t\tlog.error(msg, error);\n\t\t\t\tthrow new Error(msg, {\n\t\t\t\t\tcause: error,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\t// Run additional cleanups\n\t\ttry {\n\t\t\tawait additionalCleanups?.();\n\t\t} catch (error) {\n\t\t\tconst msg = `Error while running additional cleanups`;\n\t\t\tlog.error(msg, error);\n\t\t\tthrow new Error(msg, {\n\t\t\t\tcause: error,\n\t\t\t});\n\t\t}\n\t\tawait refreshAdapter(betterAuthOptions);\n\t\tlog.success(\n\t\t\t`${TTY_COLORS.bright}CLEAN-UP${TTY_COLORS.reset} completed successfully (${(performance.now() - start).toFixed(3)}ms)`,\n\t\t);\n\t};\n\n\t/**\n\t * A function that will run the database migrations.\n\t */\n\tconst migrate = async () => {\n\t\tconst start = performance.now();\n\n\t\ttry {\n\t\t\tawait runMigrations(betterAuthOptions);\n\t\t} catch (error) {\n\t\t\tconst msg = `Error while running migrations`;\n\t\t\tlog.error(msg, error);\n\t\t\tthrow new Error(msg, {\n\t\t\t\tcause: error,\n\t\t\t});\n\t\t}\n\t\tlog.success(\n\t\t\t`${TTY_COLORS.bright}MIGRATIONS${TTY_COLORS.reset} completed successfully (${(performance.now() - start).toFixed(3)}ms)`,\n\t\t);\n\t};\n\n\treturn {\n\t\texecute: () => {\n\t\t\tdescribe(adapterDisplayName, async () => {\n\t\t\t\t// Collect statistics from all test suites\n\t\t\t\tconst allSuiteStats: TestSuiteStats[] = [];\n\n\t\t\t\tbeforeAll(async () => {\n\t\t\t\t\tawait migrate();\n\t\t\t\t}, 60000);\n\n\t\t\t\tafterAll(async () => {\n\t\t\t\t\tawait cleanup();\n\n\t\t\t\t\t// Display statistics summary\n\t\t\t\t\tif (allSuiteStats.length > 0) {\n\t\t\t\t\t\tconst totalMigrations = allSuiteStats.reduce(\n\t\t\t\t\t\t\t(sum, stats) => sum + stats.migrationCount,\n\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst totalMigrationTime = allSuiteStats.reduce(\n\t\t\t\t\t\t\t(sum, stats) => sum + stats.totalMigrationTime,\n\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst totalTests = allSuiteStats.reduce(\n\t\t\t\t\t\t\t(sum, stats) => sum + stats.testCount,\n\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst totalDuration = allSuiteStats.reduce(\n\t\t\t\t\t\t\t(sum, stats) => sum + stats.suiteDuration,\n\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tconst dash = \"─\";\n\t\t\t\t\t\tconst separator = `${dash.repeat(80)}`;\n\n\t\t\t\t\t\tconsole.log(`\\n${TTY_COLORS.fg.cyan}${separator}`);\n\t\t\t\t\t\tconsole.log(\n\t\t\t\t\t\t\t`${TTY_COLORS.fg.cyan}${TTY_COLORS.bright}TEST SUITE STATISTICS SUMMARY${TTY_COLORS.reset}`,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconsole.log(\n\t\t\t\t\t\t\t`${TTY_COLORS.fg.cyan}${separator}${TTY_COLORS.reset}\\n`,\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t// Per-suite breakdown\n\t\t\t\t\t\tfor (const stats of allSuiteStats) {\n\t\t\t\t\t\t\tconst avgMigrationTime =\n\t\t\t\t\t\t\t\tstats.migrationCount > 0\n\t\t\t\t\t\t\t\t\t? (stats.totalMigrationTime / stats.migrationCount).toFixed(2)\n\t\t\t\t\t\t\t\t\t: \"0.00\";\n\t\t\t\t\t\t\tconsole.log(\n\t\t\t\t\t\t\t\t`${TTY_COLORS.fg.magenta}${stats.suiteName}${TTY_COLORS.reset}:`,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tconsole.log(\n\t\t\t\t\t\t\t\t` Tests: ${TTY_COLORS.fg.green}${stats.testCount}${TTY_COLORS.reset}`,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tconsole.log(\n\t\t\t\t\t\t\t\t` Migrations: ${TTY_COLORS.fg.yellow}${stats.migrationCount}${TTY_COLORS.reset} (avg: ${avgMigrationTime}ms)`,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tconsole.log(\n\t\t\t\t\t\t\t\t` Total Migration Time: ${TTY_COLORS.fg.yellow}${stats.totalMigrationTime.toFixed(2)}ms${TTY_COLORS.reset}`,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tconsole.log(\n\t\t\t\t\t\t\t\t` Suite Duration: ${TTY_COLORS.fg.blue}${stats.suiteDuration.toFixed(2)}ms${TTY_COLORS.reset}`,\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t// Display grouping statistics if available\n\t\t\t\t\t\t\tif (stats.groupingStats) {\n\t\t\t\t\t\t\t\tconst {\n\t\t\t\t\t\t\t\t\ttotalGroups,\n\t\t\t\t\t\t\t\t\taverageTestsPerGroup,\n\t\t\t\t\t\t\t\t\tlargestGroupSize,\n\t\t\t\t\t\t\t\t\tsmallestGroupSize,\n\t\t\t\t\t\t\t\t\tgroupsWithMultipleTests,\n\t\t\t\t\t\t\t\t} = stats.groupingStats;\n\t\t\t\t\t\t\t\tconsole.log(\n\t\t\t\t\t\t\t\t\t` Test Groups: ${TTY_COLORS.fg.cyan}${totalGroups}${TTY_COLORS.reset}`,\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tif (totalGroups > 0) {\n\t\t\t\t\t\t\t\t\tconsole.log(\n\t\t\t\t\t\t\t\t\t\t` Avg Tests/Group: ${TTY_COLORS.fg.cyan}${averageTestsPerGroup.toFixed(2)}${TTY_COLORS.reset}`,\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\tconsole.log(\n\t\t\t\t\t\t\t\t\t\t` Largest Group: ${TTY_COLORS.fg.cyan}${largestGroupSize}${TTY_COLORS.reset}`,\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\tconsole.log(\n\t\t\t\t\t\t\t\t\t\t` Smallest Group: ${TTY_COLORS.fg.cyan}${smallestGroupSize}${TTY_COLORS.reset}`,\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\tconsole.log(\n\t\t\t\t\t\t\t\t\t\t` Groups w/ Multiple Tests: ${TTY_COLORS.fg.cyan}${groupsWithMultipleTests}${TTY_COLORS.reset}`,\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tconsole.log(\"\");\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Totals\n\t\t\t\t\t\tconst avgMigrationTime =\n\t\t\t\t\t\t\ttotalMigrations > 0\n\t\t\t\t\t\t\t\t? (totalMigrationTime / totalMigrations).toFixed(2)\n\t\t\t\t\t\t\t\t: \"0.00\";\n\n\t\t\t\t\t\t// Calculate total grouping statistics\n\t\t\t\t\t\tconst totalGroups = allSuiteStats.reduce(\n\t\t\t\t\t\t\t(sum, stats) => sum + (stats.groupingStats?.totalGroups || 0),\n\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst totalGroupsWithMultipleTests = allSuiteStats.reduce(\n\t\t\t\t\t\t\t(sum, stats) =>\n\t\t\t\t\t\t\t\tsum + (stats.groupingStats?.groupsWithMultipleTests || 0),\n\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst totalTestsInGroups = allSuiteStats.reduce(\n\t\t\t\t\t\t\t(sum, stats) =>\n\t\t\t\t\t\t\t\tsum + (stats.groupingStats?.totalTestsInGroups || 0),\n\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst avgTestsPerGroup =\n\t\t\t\t\t\t\ttotalGroups > 0 ? totalTestsInGroups / totalGroups : 0;\n\n\t\t\t\t\t\tconsole.log(`${TTY_COLORS.fg.cyan}${separator}`);\n\t\t\t\t\t\tconsole.log(\n\t\t\t\t\t\t\t`${TTY_COLORS.fg.cyan}${TTY_COLORS.bright}TOTALS${TTY_COLORS.reset}`,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconsole.log(\n\t\t\t\t\t\t\t` Total Tests: ${TTY_COLORS.fg.green}${totalTests}${TTY_COLORS.reset}`,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconsole.log(\n\t\t\t\t\t\t\t` Total Migrations: ${TTY_COLORS.fg.yellow}${totalMigrations}${TTY_COLORS.reset} (avg: ${avgMigrationTime}ms)`,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconsole.log(\n\t\t\t\t\t\t\t` Total Migration Time: ${TTY_COLORS.fg.yellow}${totalMigrationTime.toFixed(2)}ms${TTY_COLORS.reset}`,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconsole.log(\n\t\t\t\t\t\t\t` Total Duration: ${TTY_COLORS.fg.blue}${totalDuration.toFixed(2)}ms${TTY_COLORS.reset}`,\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t// Display total grouping statistics\n\t\t\t\t\t\tif (totalGroups > 0) {\n\t\t\t\t\t\t\tconsole.log(\n\t\t\t\t\t\t\t\t` Total Test Groups: ${TTY_COLORS.fg.cyan}${totalGroups}${TTY_COLORS.reset}`,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tconsole.log(\n\t\t\t\t\t\t\t\t` Avg Tests/Group: ${TTY_COLORS.fg.cyan}${avgTestsPerGroup.toFixed(2)}${TTY_COLORS.reset}`,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tconsole.log(\n\t\t\t\t\t\t\t\t` Groups w/ Multiple Tests: ${TTY_COLORS.fg.cyan}${totalGroupsWithMultipleTests}${TTY_COLORS.reset}`,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconsole.log(\n\t\t\t\t\t\t\t`${TTY_COLORS.fg.cyan}${separator}${TTY_COLORS.reset}\\n`,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\tawait onFinish?.();\n\t\t\t\t}, 60000);\n\n\t\t\t\tfor (const testSuite of tests) {\n\t\t\t\t\tawait testSuite({\n\t\t\t\t\t\tadapter: async () => {\n\t\t\t\t\t\t\tawait refreshAdapter(betterAuthOptions);\n\t\t\t\t\t\t\treturn adapter;\n\t\t\t\t\t\t},\n\t\t\t\t\t\tadapterDisplayName,\n\t\t\t\t\t\tlog,\n\t\t\t\t\t\tgetBetterAuthOptions: () => betterAuthOptions,\n\t\t\t\t\t\tmodifyBetterAuthOptions: async (options) => {\n\t\t\t\t\t\t\tconst newOptions = deepmerge(defaultBAOptions, options);\n\t\t\t\t\t\t\tbetterAuthOptions = deepmerge(\n\t\t\t\t\t\t\t\tnewOptions,\n\t\t\t\t\t\t\t\toverrideBetterAuthOptions?.(newOptions) || {},\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tawait refreshAdapter(betterAuthOptions);\n\t\t\t\t\t\t\treturn betterAuthOptions;\n\t\t\t\t\t\t},\n\t\t\t\t\t\tcleanup,\n\t\t\t\t\t\tprefixTests,\n\t\t\t\t\t\trunMigrations: migrate,\n\t\t\t\t\t\tonTestFinish: async (stats: TestSuiteStats)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