Implemented integration tests for BLE functionality covering: - Connection flow state machine (connecting, discovering, ready) - Event system (listeners, state changes, connection events) - WiFi operations (scan, configure, status, reboot) - Error handling (timeouts, disconnections, concurrent connections) - Batch operations (multiple device connections, cleanup) - State machine edge cases (device name, timestamps) Tests cover both RealBLEManager and MockBLEManager to ensure consistent behavior across real devices and simulator. Updated Jest configuration: - Added expo winter runtime mocks - Added structuredClone polyfill - Added React Native module mocks (Platform, PermissionsAndroid, Linking, Alert) - Updated transform ignore patterns for BLE modules All 36 tests passing with comprehensive coverage of BLE integration. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
28 lines
850 B
JavaScript
28 lines
850 B
JavaScript
module.exports = {
|
|
preset: 'jest-expo',
|
|
testEnvironment: 'node',
|
|
setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
|
|
transformIgnorePatterns: [
|
|
'node_modules/(?!(expo|expo-router|expo-font|expo-asset|expo-constants|expo-modules-core|@expo/.*|@expo-google-fonts/.*|@react-native|react-native|@react-navigation|react-navigation|@unimodules/.*|unimodules|sentry-expo|native-base|react-native-svg|react-native-ble-plx|react-native-base64)/)',
|
|
],
|
|
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
|
|
moduleNameMapper: {
|
|
'^@/(.*)$': '<rootDir>/$1',
|
|
},
|
|
collectCoverageFrom: [
|
|
'components/**/*.{ts,tsx}',
|
|
'app/**/*.{ts,tsx}',
|
|
'services/**/*.{ts,tsx}',
|
|
'contexts/**/*.{ts,tsx}',
|
|
'!**/*.d.ts',
|
|
'!**/node_modules/**',
|
|
],
|
|
globals: {
|
|
'ts-jest': {
|
|
tsconfig: {
|
|
jsx: 'react',
|
|
},
|
|
},
|
|
},
|
|
};
|