mirror of
https://github.com/aljazceru/turso.git
synced 2025-12-26 04:24:21 +01:00
Add tests
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user