Skip to content

Commit dc3c7ab

Browse files
committed
Add test case for get() with no parameters
As I was debugging something, I noticed that we have no tests for get() with no parameters so let's add one.
1 parent 1df5a35 commit dc3c7ab

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

integration-tests/tests/async.test.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,16 @@ test.serial("Statement.run() [positional]", async (t) => {
4949
t.is(info.lastInsertRowid, 3);
5050
});
5151

52+
test.serial("Statement.get() [no parameters]", async (t) => {
53+
const db = t.context.db;
54+
55+
var stmt = 0;
56+
57+
stmt = await db.prepare("SELECT * FROM users");
58+
t.is(stmt.get().name, "Alice");
59+
t.deepEqual(await stmt.raw().get(), [1, 'Alice', 'alice@example.org']);
60+
});
61+
5262
test.serial("Statement.get() [positional]", async (t) => {
5363
const db = t.context.db;
5464

integration-tests/tests/sync.test.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,16 @@ test.serial("Statement.run() [positional]", async (t) => {
5050
t.is(info.lastInsertRowid, 3);
5151
});
5252

53+
test.serial("Statement.get() [no parameters]", async (t) => {
54+
const db = t.context.db;
55+
56+
var stmt = 0;
57+
58+
stmt = db.prepare("SELECT * FROM users");
59+
t.is(stmt.get().name, "Alice");
60+
t.deepEqual(stmt.raw().get(), [1, 'Alice', 'alice@example.org']);
61+
});
62+
5363
test.serial("Statement.get() [positional]", async (t) => {
5464
const db = t.context.db;
5565

0 commit comments

Comments
 (0)