Appearance
Test Scripts
The scripts/test/ directory contains cross-platform and integration test suites.
Contract Tests (test/contracts.ts)
Validates that the server API responses match the Dart models in the mobile app.
bash
bun test:contracts
# or directly: bun scripts/test/contracts.tsPhase 1 (Bun):
- Start an in-memory test server
- Seed navigation data (location, floor, nodes, edges, token)
- Hit navigation API endpoints
- Write real JSON responses to
mobile/test/fixtures/*.json
Phase 2 (Dart):
- Run
flutter test test/contract_test.dartin the mobile directory - Dart tests read the fixtures and verify models parse correctly
Binary Smoke Tests (test/binary.sh)
Compiles the server binary for the host architecture, boots it with a minimal config, and verifies key endpoints.
bash
bash scripts/test/binary.sh # compile + test
bash scripts/test/binary.sh --skip-build # test existing binarySteps:
- Compile binary for host architecture
- Create temp working directory with minimal
main.config.json - Start the binary on a random port
- Hit endpoints:
/version,/, static assets,/login, authenticated routes - Report pass/fail counts
This runs automatically as part of the server build pipeline (build/server.sh).
VM Integration Tests (test/vm.sh)
Full lifecycle test designed to run on a clean Linux VM (Ubuntu/Debian).
bash
sudo bash scripts/test/vm.sh # run all tests
sudo bash scripts/test/vm.sh --quick # skip interactive + optional services
sudo bash scripts/test/vm.sh --clean # remove all artifacts and exitTests the complete lifecycle:
- Installer download and execution
- Phase 1 install (binary, scripts, default config)
- Phase 2 setup (service, nginx, cron)
- CLI commands (config, user, status, selftest)
- Service management (start, stop, restart)
- Nginx and cron configuration
- Update and repair workflows
- Clean uninstall
Prerequisites:
- Clean Ubuntu/Debian VM (22.04+)
- Root access
- Internet connection (downloads from updates.wantok.cz)
Other Test Commands
Server unit tests and web type checking are run separately:
bash
# Server unit tests
cd server && bun test
# Mobile tests
cd mobile && flutter test
# Web type checking
cd web && bun run typecheck