Skip to content

Commit ac9eb37

Browse files
committed
Fix crash due to test ordering?
1 parent a75d6e5 commit ac9eb37

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

tools/powersynctests/src/tests/queries.test.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -685,6 +685,14 @@ export function registerBaseTests() {
685685
await Promise.all(promises);
686686
});
687687

688+
it('readTransaction', async () => {
689+
await db.execute('INSERT INTO users (id, name) VALUES (uuid(), ?)', ['name']);
690+
const names = await db.readTransaction(async (tx) => {
691+
return await tx.getAll<{name: string}>('SELECT name FROM users');
692+
});
693+
expect(names).deep.equal([{name: 'name'}]);
694+
});
695+
688696
it('Should handle multiple closes', async () => {
689697
// Bulk insert 10000 rows without using a transaction
690698
const bulkInsertCommands = [];
@@ -721,12 +729,6 @@ export function registerBaseTests() {
721729
}
722730
});
723731

724-
it('readTransaction', async () => {
725-
await db.execute('INSERT INTO users (id, name) VALUES (uuid(), ?)', ['name']);
726-
const names = await db.readTransaction(async (tx) => {
727-
return await tx.getAll<{name: string}>('SELECT name FROM users');
728-
});
729-
expect(names).deep.equal([{name: 'name'}]);
730-
});
732+
731733
});
732734
}

0 commit comments

Comments
 (0)