mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-16 12:37:20 +00:00
fixing tests, move node tests to vitest
This commit is contained in:
@@ -8,12 +8,14 @@ import {
|
||||
GenericSqliteDialect,
|
||||
} from "kysely-generic-sqlite";
|
||||
import { SqliteConnection } from "./SqliteConnection";
|
||||
import type { Features } from "../Connection";
|
||||
|
||||
export type GenericSqliteConnectionConfig = {
|
||||
name: string;
|
||||
additionalPlugins?: KyselyPlugin[];
|
||||
excludeTables?: string[];
|
||||
onCreateConnection?: OnCreateConnection;
|
||||
supports?: Partial<Features>;
|
||||
};
|
||||
|
||||
export { parseBigInt, buildQueryFn, GenericSqliteDialect, type IGenericSqlite };
|
||||
@@ -33,5 +35,15 @@ export class GenericSqliteConnection<DB = unknown> extends SqliteConnection<DB>
|
||||
excludeTables: config?.excludeTables,
|
||||
});
|
||||
this.client = db;
|
||||
if (config?.name) {
|
||||
this.name = config.name;
|
||||
}
|
||||
if (config?.supports) {
|
||||
for (const [key, value] of Object.entries(config.supports)) {
|
||||
if (value) {
|
||||
this.supported[key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,10 +2,11 @@ import { connectionTestSuite } from "../connection-test-suite";
|
||||
import { LibsqlConnection } from "./LibsqlConnection";
|
||||
import { bunTestRunner } from "adapter/bun/test";
|
||||
import { describe } from "bun:test";
|
||||
import { createClient } from "@libsql/client";
|
||||
|
||||
describe("LibsqlConnection", () => {
|
||||
connectionTestSuite(bunTestRunner, {
|
||||
makeConnection: () => new LibsqlConnection({ url: ":memory:" }),
|
||||
makeConnection: () => new LibsqlConnection(createClient({ url: ":memory:" })),
|
||||
rawDialectDetails: ["rowsAffected", "lastInsertRowid"],
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user