Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ospfranco committed Dec 22, 2024
1 parent 3bb9072 commit db21050
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 22 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -264,17 +264,12 @@ jobs:
${{ runner.os }}-cocoapods-
- name: Install cocoapods
# if: env.turbo_cache_hit != 1 && steps.cocoapods-cache.outputs.cache-hit != 'true'
run: |
cd example/ios
bundle exec pod install
env:
NO_FLIPPER: 1

# - name: Build example for iOS
# run: |
# yarn turbo run run:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}"

- name: run tests
run: |
./scripts/test-ios.sh
Expand Down
30 changes: 13 additions & 17 deletions example/src/tests/hooks.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ export function registerHooksTests() {
});

db.updateHook(data => {
console.log('UPDATE HOOK CALLED');
promiseResolve(data);
});

Expand All @@ -66,8 +65,6 @@ export function registerHooksTests() {
);
});

console.log('AWAITING UPDATE HOOK PROMISE');

const data = await promise;

expect(data.operation).to.equal('INSERT');
Expand All @@ -78,10 +75,7 @@ export function registerHooksTests() {

it('remove update hook', async () => {
const hookRes: string[] = [];
let db = open({
name: 'updateHookDb.sqlite',
encryptionKey: 'blah',
});

db.updateHook(({operation}) => {
hookRes.push(operation);
});
Expand All @@ -90,19 +84,21 @@ export function registerHooksTests() {
const name = chance.name();
const age = chance.integer();
const networth = chance.floating();
// await db.transaction(async tx => {
await db.execute(
'INSERT INTO "User" (id, name, age, networth) VALUES(?, ?, ?, ?)',
[id, name, age, networth],
);
// });
await db.transaction(async tx => {
await tx.execute(
'INSERT INTO "User" (id, name, age, networth) VALUES(?, ?, ?, ?)',
[id, name, age, networth],
);
});

db.updateHook(null);

await db.execute(
'INSERT INTO "User" (id, name, age, networth) VALUES(?, ?, ?, ?)',
[id + 1, name, age, networth],
);
await db.transaction(async tx => {
await tx.execute(
'INSERT INTO "User" (id, name, age, networth) VALUES(?, ?, ?, ?)',
[id + 1, name, age, networth],
);
});

await sleep(0);

Expand Down

0 comments on commit db21050

Please sign in to comment.