completion

This commit is contained in:
2025-08-06 13:49:11 +08:00
commit c2d7317897
684 changed files with 92987 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
/* global jest: true */
jest.mock('@react-native-community/async-storage', () => ({
getItem: () => Promise.resolve(),
setItem: () => Promise.resolve(),
mergeItem: () => Promise.resolve(),
removeItem: () => Promise.resolve(),
}));

View File

@@ -0,0 +1,11 @@
/* global jest: true */
const geolocation = {
setRNConfiguration: jest.fn(() => {}),
getCurrentPosition: jest.fn(() => {}),
watchPosition: jest.fn(() => {}),
clearWatch: jest.fn(() => {}),
stopObserving: jest.fn(() => {}),
};
export default geolocation;

View File

@@ -0,0 +1,35 @@
/* global jest: false */
import { NativeModules } from 'react-native';
jest.mock('@react-native-community/google-signin', () => {
const mockGoogleSignin = require.requireActual('@react-native-community/google-signin');
mockGoogleSignin.GoogleSignin.hasPlayServices = () => Promise.resolve(true);
mockGoogleSignin.GoogleSignin.configure = () => Promise.resolve();
mockGoogleSignin.GoogleSignin.currentUserAsync = () => Promise.resolve({
name: 'name',
email: 'test@example.com',
// .... other user data
});
// ... and other functions you want to mock
return mockGoogleSignin;
});
NativeModules.RNGoogleSignin = {
BUTTON_SIZE_ICON: 0,
BUTTON_SIZE_STANDARD: 0,
BUTTON_SIZE_WIDE: 0,
BUTTON_COLOR_AUTO: 0,
BUTTON_COLOR_LIGHT: 0,
BUTTON_COLOR_DARK: 0,
SIGN_IN_CANCELLED: '0',
IN_PROGRESS: '1',
PLAY_SERVICES_NOT_AVAILABLE: '2',
SIGN_IN_REQUIRED: '3',
configure: jest.fn(),
currentUserAsync: jest.fn(),
};
export { NativeModules };

View File

@@ -0,0 +1,7 @@
/* global jest: true */
jest.mock('@react-native-community/netinfo', () => ({
getConnectionInfo: () => Promise.resolve(),
addEventListener: jest.fn(),
isConnected: jest.fn(),
}));

View File

@@ -0,0 +1,5 @@
/* global jest: true */
jest.mock('@react-native-community/push-notification-ios', () => ({
}));