mirror of
https://github.com/tursodatabase/limbo.git
synced 2025-08-04 18:18:03 +00:00
Add tests
This commit is contained in:
parent
c00ebe94c0
commit
6f88505f90
2 changed files with 13 additions and 0 deletions
|
@ -101,6 +101,12 @@ test("Test Statement.database gets the database object", async t => {
|
|||
t.is(stmt.database, db);
|
||||
});
|
||||
|
||||
test("Test Statement.source", async t => {
|
||||
const [db] = await connect(":memory:");
|
||||
let sql = "CREATE TABLE t (id int)";
|
||||
let stmt = db.prepare(sql);
|
||||
t.is(stmt.source, sql);
|
||||
});
|
||||
|
||||
const connect = async (path) => {
|
||||
const db = new Database(path);
|
||||
|
|
|
@ -161,6 +161,13 @@ test("Test Statement.database gets the database object", async t => {
|
|||
t.is(stmt.database, db);
|
||||
});
|
||||
|
||||
test("Test Statement.source", async t => {
|
||||
const [db] = await connect(":memory:");
|
||||
let sql = "CREATE TABLE t (id int)";
|
||||
let stmt = db.prepare(sql);
|
||||
t.is(stmt.source, sql);
|
||||
});
|
||||
|
||||
const connect = async (path) => {
|
||||
const db = new Database(path);
|
||||
return [db];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue