mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-17 04:46:05 +00:00
fixing tests, move node tests to vitest
This commit is contained in:
@@ -1,17 +1,11 @@
|
||||
/// <reference types="bun-types" />
|
||||
|
||||
import path from "node:path";
|
||||
import {
|
||||
type RuntimeBkndConfig,
|
||||
createRuntimeApp,
|
||||
type RuntimeOptions,
|
||||
Connection,
|
||||
} from "bknd/adapter";
|
||||
import { type RuntimeBkndConfig, createRuntimeApp, type RuntimeOptions } from "bknd/adapter";
|
||||
import { registerLocalMediaAdapter } from ".";
|
||||
import { config } from "bknd/core";
|
||||
import type { ServeOptions } from "bun";
|
||||
import { serveStatic } from "hono/bun";
|
||||
import { sqlite } from "bknd/adapter/sqlite";
|
||||
import type { App } from "App";
|
||||
|
||||
type BunEnv = Bun.Env;
|
||||
@@ -25,17 +19,9 @@ export async function createApp<Env = BunEnv>(
|
||||
const root = path.resolve(distPath ?? "./node_modules/bknd/dist", "static");
|
||||
registerLocalMediaAdapter();
|
||||
|
||||
let connection: Connection | undefined;
|
||||
if (Connection.isConnection(config.connection)) {
|
||||
connection = config.connection;
|
||||
} else {
|
||||
connection = sqlite(config.connection ?? { url: ":memory:" });
|
||||
}
|
||||
|
||||
return await createRuntimeApp(
|
||||
{
|
||||
...config,
|
||||
connection,
|
||||
serveStatic: serveStatic({ root }),
|
||||
},
|
||||
args ?? (process.env as Env),
|
||||
|
||||
Reference in New Issue
Block a user