Add tests

This commit is contained in:
Anton Harniakou
2025-06-05 09:59:20 +03:00
parent 9f17be8162
commit 1adaa927e6
2 changed files with 12 additions and 0 deletions

View File

@@ -95,6 +95,12 @@ test("Test exec()", async (t) => {
}
});
test("Test Statement.database gets the database object", async t => {
const [db] = await connect(":memory:");
let stmt = db.prepare("SELECT 1");
t.is(stmt.database, db);
});
const connect = async (path) => {
const db = new Database(path);

View File

@@ -155,6 +155,12 @@ test("Test exec()", async (t) => {
}
});
test("Test Statement.database gets the database object", async t => {
const [db] = await connect(":memory:");
let stmt = db.prepare("SELECT 1");
t.is(stmt.database, db);
});
const connect = async (path) => {
const db = new Database(path);
return [db];