binds: Add empty prepared statement tests

This commit is contained in:
Diego Reis
2025-05-08 16:32:08 -03:00
parent c4e7be04f8
commit bc72c396f0
2 changed files with 33 additions and 17 deletions

View File

@@ -31,6 +31,13 @@ test("Statement.run() returns correct result object", async (t) => {
t.deepEqual(rows, { changes: 1, lastInsertRowid: 1 });
});
test("Empty prepared statement should throw", async (t) => {
const [db] = await connect(":memory:");
t.throws(() => {
db.prepare("");
}, { instanceOf: Error });
});
const connect = async (path) => {
const db = new Database(path);
return [db];