feat: implement tests#2
Open
damlayildiz wants to merge 19 commits intofix/extractChangesFromResultfrom
Open
Conversation
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
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.