A modern, feature-rich note-taking application built with React Native, Expo, and Supabase.
- π Text Notes - Create and edit rich text notes
- π€ Audio Notes - Record voice notes with AI transcription
- π·οΈ Tags & Organization - Organize notes with tags and categories
- π Search & Filter - Find notes quickly with advanced search
- βοΈ Cloud Sync - Real-time synchronization with Supabase
- π Authentication - Secure user authentication with Supabase Auth
- π Dark Theme - Beautiful dark theme with smooth animations
- π± Cross-Platform - Works on iOS, Android, and Web
β οΈ Note: Export functionality is currently not implemented and will be added in a future update.
This project includes a comprehensive testing suite with unit tests, integration tests, and component tests.
__tests__/
βββ hooks/ # Hook tests (useAuth, useNotes)
βββ components/ # Component tests (NoteCard, etc.)
βββ screens/ # Screen integration tests
βββ services/ # Service tests (AuthService, etc.)
# Run all tests
npm test
# Run tests in watch mode
npm run test:watch
# Run tests with coverage
npm run test:coverage
# Run tests for CI/CD
npm run test:ci
# Run specific test file
npm test -- __tests__/hooks/useAuth.test.ts
# Run tests matching pattern
npm test -- --testNamePattern="useAuth"
# Update snapshots
npm test -- --updateSnapshot
# Debug tests
npm test -- --verbose --detectOpenHandles
The test suite covers:
- β Hooks - useAuth, useNotes
- β Components - NoteCard, LoadingSpinner, VoiceRecorder
- β Screens - HomeScreen, CreateScreen, SettingsScreen
- β Services - AuthService, SupabaseNoteStorage
- β Utilities - Date formatting, data filtering
- Hooks - Test custom React hooks in isolation
- Services - Test business logic and API calls
- Utilities - Test helper functions and data processing
- Rendering - Test component rendering and props
- User Interactions - Test button clicks, form submissions
- State Changes - Test component state updates
- Error Handling - Test error states and edge cases
- Screen Flows - Test complete user journeys
- Navigation - Test screen transitions and routing
- Data Flow - Test data passing between components
// jest.config.js
module.exports = {
preset: 'jest-expo',
setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
collectCoverageFrom: [
'**/*.{ts,tsx}',
'!**/coverage/**',
'!**/node_modules/**',
],
testMatch: [
'**/__tests__/**/*.(ts|tsx|js)',
'**/*.(test|spec).(ts|tsx|js)',
],
};
// jest.setup.js
import '@testing-library/jest-native/extend-expect';
// Mock Expo Router
jest.mock('expo-router', () => ({
useRouter: () => ({
push: jest.fn(),
replace: jest.fn(),
back: jest.fn(),
}),
}));
// Mock Supabase
jest.mock('@supabase/supabase-js', () => ({
initializeApp: jest.fn(),
}));
import { renderHook, act } from '@testing-library/react-native';
import { useAuth } from '../../hooks/useAuth';
describe('useAuth', () => {
it('should initialize with loading state', () => {
const { result } = renderHook(() => useAuth());
expect(result.current.isLoading).toBe(true);
expect(result.current.user).toBe(null);
});
});
import { render, fireEvent } from '@testing-library/react-native';
import { NoteCard } from '../../components/NoteCard';
describe('NoteCard', () => {
it('should render note title and content', () => {
const { getByText } = render(<NoteCard {...mockProps} />);
expect(getByText('Test Note')).toBeTruthy();
expect(getByText('Test content')).toBeTruthy();
});
});
name: Tests
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '18'
- run: npm ci
- run: npm run test:ci
- run: npm run lint
Generate detailed coverage reports:
npm run test:coverage
This will create:
- HTML Report -
coverage/lcov-report/index.html
- Console Output - Coverage summary in terminal
- LCOV File -
coverage/lcov.info
for CI tools
npm test -- --verbose --detectOpenHandles
npm run test:watch -- --verbose
npm test -- --testNamePattern="useAuth" --verbose
- Node.js 18+
- npm or yarn
- Expo CLI
# Clone the repository
git clone <repository-url>
cd notezReact
# Install dependencies
npm install
# Start development server
npm start
# Copy environment template
cp .env.example .env
# Add your Supabase configuration
EXPO_PUBLIC_SUPABASE_URL=your_supabase_url
EXPO_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
# iOS
npm run ios
# Android
npm run android
# Web
npm run web
# Build for production
expo build:android
expo build:ios
npx expo start
$env:APP_VARIANT="development"; npx expo start
$env:APP_VARIANT="preview"; npx expo start
eas build --platform android --profile preview
npx expo start --web
- Fork the repository
- Create a feature branch
- Write tests for new features
- Ensure all tests pass
- Submit a pull request
This project is licensed under the MIT License.