Skip to content

Commit 67496a3

Browse files
committed
integration-tests: Improve Statement.run() tests
1 parent 3d608a9 commit 67496a3

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

integration-tests/tests/async.test.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ test.serial("Statement.run() [positional]", async (t) => {
5050
const info = stmt.run(["Carol", "carol@example.net"]);
5151
t.is(info.changes, 1);
5252
t.is(info.lastInsertRowid, 3);
53+
54+
// Verify that the data is inserted
55+
const stmt2 = await db.prepare("SELECT * FROM users WHERE id = 3");
56+
t.is(stmt2.get().name, "Carol");
57+
t.is(stmt2.get().email, "carol@example.net");
5358
});
5459

5560
test.serial("Statement.get() returns no rows", async (t) => {

integration-tests/tests/sync.test.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ test.serial("Statement.run() [positional]", async (t) => {
5858
const info = stmt.run(["Carol", "carol@example.net"]);
5959
t.is(info.changes, 1);
6060
t.is(info.lastInsertRowid, 3);
61+
62+
// Verify that the data is inserted
63+
const stmt2 = db.prepare("SELECT * FROM users WHERE id = 3");
64+
t.is(stmt2.get().name, "Carol");
65+
t.is(stmt2.get().email, "carol@example.net");
6166
});
6267

6368
test.serial("Statement.run() [named]", async (t) => {

0 commit comments

Comments
 (0)