Skip to content

Commit 56be6da

Browse files
committed
test: fix database async tests
1 parent 02d12b0 commit 56be6da

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

test/parallel/test-sqlite-database-async.mjs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,10 @@ suite('Database() constructor', () => {
8686
});
8787
});
8888

89-
test('is not read-only by default', (t) => {
89+
test('is not read-only by default', async (t) => {
9090
const dbPath = nextDb();
9191
const db = new Database(dbPath);
92-
db.exec('CREATE TABLE foo (id INTEGER PRIMARY KEY)');
92+
await db.exec('CREATE TABLE foo (id INTEGER PRIMARY KEY)');
9393
});
9494

9595
test('is read-only if readOnly is set', async (t) => {
@@ -132,15 +132,15 @@ suite('Database() constructor', () => {
132132
});
133133
});
134134

135-
test('allows disabling foreign key constraints', (t) => {
135+
test('allows disabling foreign key constraints', async (t) => {
136136
const dbPath = nextDb();
137137
const db = new Database(dbPath, { enableForeignKeyConstraints: false });
138-
db.exec(`
138+
await db.exec(`
139139
CREATE TABLE foo (id INTEGER PRIMARY KEY);
140140
CREATE TABLE bar (foo_id INTEGER REFERENCES foo(id));
141141
`);
142142
t.after(() => { db.close(); });
143-
db.exec('INSERT INTO bar (foo_id) VALUES (1)');
143+
await db.exec('INSERT INTO bar (foo_id) VALUES (1)');
144144
});
145145

146146
test('throws if options.enableDoubleQuotedStringLiterals is provided but is not a boolean', (t) => {
@@ -162,11 +162,11 @@ suite('Database() constructor', () => {
162162
});
163163
});
164164

165-
test('allows enabling double-quoted string literals', (t) => {
165+
test('allows enabling double-quoted string literals', async (t) => {
166166
const dbPath = nextDb();
167167
const db = new Database(dbPath, { enableDoubleQuotedStringLiterals: true });
168168
t.after(() => { db.close(); });
169-
db.exec('SELECT "foo";');
169+
await db.exec('SELECT "foo";');
170170
});
171171

172172
test('throws if options.readBigInts is provided but is not a boolean', (t) => {

0 commit comments

Comments
 (0)