Testing
Unit tests
TypeScript tests run with Vitest; the Swift helpers and the RPC transport run with SwiftPM
(swift test).
- Tests never make real network calls or start a Google login flow.
- Mock Electron APIs (
session,webContents,BrowserWindow,nativeTheme) with Vitest test doubles. - Run these before opening a pull request:
pnpm test
pnpm typecheck
(cd packages/swift-rpc && swift test)
(cd apps/magical/swift && swift test)
(cd apps/magimail/swift && swift test)
Pre-commit hooks
Husky and lint-staged run on every git commit:
eslint --fixandprettier --writeon staged TypeScript and JavaScript.prettier --writeon JSON, Markdown and CSS.swiftformaton staged Swift files.