mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-16 04:27:21 +00:00
implement/init e2e tests (#135)
* init e2e * updated/moved vitest, finished merge * fix bun picking up e2e tests * e2e: overwrite webserver config with env * e2e: added adapter configs * e2e: replaced image
This commit is contained in:
23
app/e2e/inc/adapters.ts
Normal file
23
app/e2e/inc/adapters.ts
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user