This is a Tauri-based desktop application with Svelte frontend for the Terraphim AI assistant.
- Backend: Rust with Tauri for system integration, search, and configuration
- Frontend: Svelte with Bulma CSS for the user interface
- Features: System tray, global shortcuts, multi-theme support, typeahead search
To run in development mode:
yarn install # install dependencies
yarn run dev # run the Svelte dev server
yarn run tauri dev # run the Tauri dev serverWe have implemented a comprehensive testing strategy covering multiple aspects:
cd src-tauri
cargo test --verboseTests include:
- Unit tests for Tauri commands (search, config, thesaurus)
- Integration tests for state management
- Error handling and edge cases
- Async functionality testing
yarn test # Run unit tests
yarn test:watch # Run tests in watch mode
yarn test:coverage # Run tests with coverage
yarn test:ui # Run tests with UITests include:
- Component tests for Search, ThemeSwitcher, etc.
- Store and state management tests
- User interaction tests
- Mock Tauri API integration
yarn e2e # Run E2E tests
yarn e2e:ui # Run E2E tests with UITests include:
- Complete user workflows
- Search functionality
- Navigation and routing
- Theme switching
- Error handling
npx playwright test tests/visualTests include:
- Theme consistency across all 22 themes
- Responsive design testing
- Component visual consistency
- Accessibility visual checks
# Requires Lighthouse CI
npm install -g @lhci/cli
yarn build
lhci autorundesktop/
├── src-tauri/
│ ├── tests/
│ │ └── cmd_tests.rs # Backend unit tests
│ └── src/
│ ├── cmd.rs # Commands with test coverage
│ └── lib.rs # Exposed for testing
├── src/
│ ├── lib/
│ │ ├── Search/
│ │ │ └── Search.test.ts # Search component tests
│ │ └── ThemeSwitcher.test.ts # Theme tests
│ └── test-utils/
│ └── setup.ts # Test configuration
├── tests/
│ ├── e2e/
│ │ ├── search.spec.ts # E2E search tests
│ │ └── navigation.spec.ts # E2E navigation tests
│ ├── visual/
│ │ └── themes.spec.ts # Visual regression tests
│ ├── global-setup.ts # Test data setup
│ └── global-teardown.ts # Test cleanup
├── vitest.config.ts # Frontend test config
└── playwright.config.ts # E2E test config
- Isolation: Each test is independent and can run in any order
- Mocking: External dependencies are properly mocked
- Coverage: Aim for >80% code coverage
- Performance: Tests run efficiently in CI/CD
- Reliability: Tests are stable and don't have flaky behavior
Tests run automatically on:
- Push to main/develop branches
- Pull requests
- Multiple platforms (Ubuntu, macOS, Windows)
Test results include:
- Unit test results and coverage
- E2E test results with screenshots/videos
- Visual regression differences
- Performance metrics
- Security audit results
To build for production:
yarn install # install dependencies
yarn run build # build the Svelte app
yarn run tauri build # build the Tauri app- Backend: >90% coverage for business logic
- Frontend: >85% coverage for components and stores
- E2E: Cover all major user workflows
- Visual: Test all themes and responsive breakpoints
- Performance: Maintain Lighthouse scores >80
To run the complete test suite:
# Install dependencies
yarn install
# Run all tests
yarn test # Frontend unit tests
cd src-tauri && cargo test && cd .. # Backend tests
yarn e2e # E2E tests
npx playwright test tests/visual # Visual tests