Skip to content

Commit

Permalink
test: Sync mocks
Browse files Browse the repository at this point in the history
Co-Authored-By: Natalia Rodrigues <Natytotherodrigues@gmail.com>
  • Loading branch information
GabrielSMonteiro and Natyrodrigues committed Sep 19, 2024
1 parent 07cf6ca commit d74bc86
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/app/__tests__/watermelon.service.spec.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { synchronize } from '@nozbe/watermelondb/sync';
import AsyncStorage from '@react-native-async-storage/async-storage';
import { syncDatabaseWithServer } from '../services/watermelon.service';

jest.mock('@nozbe/watermelondb/sync', () => ({
synchronize: jest.fn()
}));

jest.mock('@react-native-async-storage/async-storage', () => ({
getItem: jest.fn()
}));

global.fetch = jest.fn();

describe('syncDatabaseWithServer', () => {
beforeEach(() => {
jest.clearAllMocks();
});
});

0 comments on commit d74bc86

Please sign in to comment.