Testing Overview
Rowboat’s testing strategy focuses on:- Type safety - TypeScript catches many errors at compile time
- Linting - ESLint enforces code quality standards
- Manual testing - Development mode for rapid iteration
- Integration testing - Testing the full Electron app
Type Checking
TypeScript provides the first line of defense against bugs.Running Type Checks
TypeScript Configuration
Each package has its owntsconfig.json:
Type definitions are generated during build. If you see “Cannot find module” errors in your IDE, run
npm run deps to rebuild type definitions.Linting
ESLint enforces code quality and catches common errors.Running the Linter
ESLint Configuration
The workspace uses ESLint 9 with flat config:Common Linting Issues
Unused Variables
React Hooks Rules
Manual Testing
Development mode enables rapid manual testing with hot reload.Starting Development Mode
Testing Workflows
UI Changes (Renderer)
- Edit files in
apps/renderer/src/ - Save - changes appear instantly via HMR
- Test in the Electron window
- Use React DevTools for debugging
Main Process Changes
- Edit files in
apps/main/src/ - Stop dev server (Ctrl+C)
- Restart:
npm run dev - Test the changes
- Check Electron console for logs
Workspace Package Changes
- Edit files in
packages/shared/src/orpackages/core/src/ - Rebuild dependencies:
npm run deps - Restart dev server:
npm run dev - Test the changes
Developer Tools
Chrome DevTools (Renderer)
Open DevTools in the Electron window:- macOS: Cmd + Option + I
- Windows/Linux: Ctrl + Shift + I
Main Process Debugging
Log to the terminal:npm run dev.
VS Code Debugging
Create.vscode/launch.json:
Integration Testing
Test the full application flow from main process to renderer.IPC Communication Testing
Test the bridge between main and renderer:Testing AI Providers
Test AI integrations with different providers:Testing File Operations
Test document parsing and file handling:Production Testing
Test the packaged application before distribution.Building for Testing
Locate the app
- macOS:
out/rowboat-darwin-arm64/Rowboat.app - Windows:
out/rowboat-win32-x64/Rowboat.exe - Linux:
out/rowboat-linux-x64/rowboat
Testing Installers
Install on clean system
Test the installer on a machine without development dependencies:
- Fresh VM or test machine
- No Node.js or development tools
- Standard user (not admin)
Continuous Verification
Run these checks before committing:Consider creating a shell script to automate these checks:
Debugging Common Issues
App Won’t Start
Renderer Not Loading
- Check Vite dev server is running: http://localhost:5173
- Check for errors in Electron DevTools console
- Verify preload script is built:
apps/preload/dist/preload.jsexists
IPC Not Working
- Rebuild preload scripts:
npm run preload - Check contextBridge exposes the APIs correctly
- Verify renderer is calling the correct API methods
- Check main process is handling IPC events
Type Errors in IDE
- Rebuild packages:
npm run deps - Restart TypeScript server in IDE
- Check
tsconfig.jsonincludes correct paths
Best Practices
- Type everything - Leverage TypeScript’s type system
- Lint frequently - Run
npm run lintbefore committing - Test across platforms - macOS, Windows, Linux behaviors differ
- Test production builds - Don’t rely solely on dev mode
- Use React DevTools - Profile performance and debug state
- Check console logs - Both main process and renderer
- Clean builds - When in doubt, clean and rebuild