Skip to content

Commit 5789ba9

Browse files
add invalid syntax error
1 parent e33a6d0 commit 5789ba9

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -558,6 +558,19 @@ export function registerBaseTests() {
558558
expect(error!.message).to.include('no such table: faketable');
559559
});
560560

561+
it('Should throw for async iterator invalid query errors', async () => {
562+
let error: Error | undefined;
563+
try {
564+
// The table here does not exist, so it should throw an error
565+
for await (const result of db.watchWithAsyncGenerator('invalidsyntax', [])) {
566+
}
567+
} catch (ex) {
568+
error = ex as Error;
569+
}
570+
571+
expect(error!.message).to.include('sqlite query error');
572+
});
573+
561574
it('Should reflect writeLock updates on read connections ', async () => {
562575
const numberOfUsers = 1000;
563576

0 commit comments

Comments
 (0)