Testing

"/home/yossef/notes/git/projects/maplibra/Testing.md"

path: maplibra/Testing.md

- **fileName**: Testing
- **Created on**: 2026-06-16 00:48:42

Testing

Purpose: How route and app behavior is verified.

Related: ./Home.md, ./Commands.md, ./modules/Route Smoothing.md, ./modules/Bootstrap System.md

Framework

Tests use Vitest. The project can run all tests with npx vitest run or focused files by passing paths.

Test Coverage Areas

Routing & Pathfinding

Graph & Binary

WASM

Startup & Bootstrap

UI & Layers

Outdoor & Navigation

Performance & Assets

Android & Mobile

Current Baseline

After the staircase straightening change, focused routing tests pass. A full run showed 295 passed and 5 known pre-existing failures in graph-slice/in-flight/snapping tests.

Known failing areas at that point:

Useful Commands

Route Trace Diagnostics

Add routing.trace=1 to the local URL, compute a route, then inspect window.InGuide.pathfindingController.getRecentRouteTraces() in DevTools. Route trace segment entries include compact coords samples for rawSegments, smoothedSegments, and renderedSegments, which makes it possible to see whether zigzags survive smoothing or are reintroduced during rendering.

Test Setup

tests/setup.js configures the Vitest environment with any global mocks or polyfills needed for Mapbox GL, Web Workers, and IndexedDB.

continue:[[]]
before:[[]]