Skip to content

Commit

Permalink
Fix update hook tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ospfranco committed Oct 31, 2024
1 parent 3ccd01c commit 0b9f28d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions example/src/tests/hooks.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,16 @@ export function registerHooksTests() {

expect(data.operation).to.equal('INSERT');
expect(data.rowId).to.equal(1);

db.close();
});

it('remove update hook', async () => {
const hookRes: string[] = [];
let db = open({
name: 'updateHookDb.sqlite',
encryptionKey: 'blah',
});
db.updateHook(({operation}) => {
hookRes.push(operation);
});
Expand All @@ -112,6 +118,7 @@ export function registerHooksTests() {
await sleep(0);

expect(hookRes.length).to.equal(1);
db.close();
});

it('commit hook', async () => {
Expand Down

0 comments on commit 0b9f28d

Please sign in to comment.