e2e: added adapter configs

This commit is contained in:
dswbx
2025-04-03 11:04:31 +02:00
parent 2cff116fcf
commit f0f2b571b5
2 changed files with 31 additions and 4 deletions
+23
View File
@@ -0,0 +1,23 @@
const adapter = process.env.TEST_ADAPTER;
const default_config = {
media_adapter: "local"
} as const;
const configs = {
cloudflare: {
media_adapter: "r2"
}
}
export function getAdapterConfig(): typeof default_config {
if (adapter) {
if (!configs[adapter]) {
throw new Error(`Adapter "${adapter}" not found. Available adapters: ${Object.keys(configs).join(", ")}`);
}
return configs[adapter] as typeof default_config;
}
return default_config;
}