Skip to content

feat: implement tests#2

Open
damlayildiz wants to merge 19 commits intofix/extractChangesFromResultfrom
feat/implement-tests
Open

feat: implement tests#2
damlayildiz wants to merge 19 commits intofix/extractChangesFromResultfrom
feat/implement-tests

Conversation

@damlayildiz
Copy link
Member

No description provided.

damlayildiz and others added 17 commits March 6, 2026 11:56
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Mock files for op-sqlite, NetInfo, expo-notifications,
expo-secure-store, expo-task-manager, expo-constants,
and expo-application.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- testUtils.tsx with createTestWrapper for hook tests
- calculateAdaptiveSyncInterval (10 tests)
- isSqliteCloudNotification (12 tests)
- logger (8 tests)
- pushNotificationSyncCallbacks (5 tests)
- constants (2 tests)
- createDatabase (9 tests)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- initializeSyncExtension (11 tests)
- executeSync (14 tests)
- backgroundSyncConfig (10 tests)
- backgroundSyncRegistry (7 tests)
- executeBackgroundSync (13 tests)
- registerPushToken (12 tests)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… hook tests (28 tests)

- pushNotificationSyncTask (8 tests)
- optionalDependencies (10 tests)
- useSqliteDb (2 tests)
- useSyncStatus (2 tests)
- useSqliteSync (2 tests)
- useInternalLogger (2 tests)
- useTriggerSqliteSync (2 tests)
- Fix react-test-renderer version to match react 19.1.0

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…nTableUpdate, useInitialSync

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…sh notifications, and reactive queries

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…n tests

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…eSyncProvider

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When cloudsync_init fails or returns no siteId, skip registerPushToken
entirely instead of registering with undefined siteId. The registration
will retry on next app open since hasRequestedPermissionsRef resets on mount.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add 10 targeted tests covering uncovered branches:
- useDatabaseInitialization: empty name, empty tables, close errors
- useSqliteExecute/Transaction: non-Error thrown value wrapping
- useSqliteSyncQuery: debounce timer clearing on query change
- usePushNotificationSync: registerPushToken failure handling
- isSqliteCloudNotification: Android dataString wrong URI
- useSyncManager: push-mode error skips interval recalculation
Add 10 targeted tests covering additional uncovered branches:
- logger: default parameter (debug=false) branch
- useNetworkListener: null isInternetReachable/isConnected coercion
- useAdaptivePollingSync: interval-to-null stops scheduling
- useOnTableUpdate: empty rows returns null row
- useSyncManager: Android with null isInternetReachable
- initializeSyncExtension: empty rows, site_id logging branches
- useSqliteSyncQuery: stale subscription signature skip
- Change auth header from Bearer connectionString?apikey=key to Bearer apiKey
- Update base URL to cloudsync-staging-testing.fly.dev
- Remove unused connectionString param from registerPushToken
@damlayildiz damlayildiz self-assigned this Mar 9, 2026
Add jest and node types to tsconfig.json, fix missing required fields
(syncMode, siteId, createTableSql) in test mocks, correct adaptive
config field names, and prefix unused variables with underscore.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant