GeoLibre Testing Strategy: A Complete Guide to Cross-Technology Quality Assurance

GeoLibre employs a layered, cross-technology testing strategy spanning front-end unit tests, Python back-end validation, Playwright E2E automation, and strict coverage enforcement across the entire stack.

The open-source geospatial platform GeoLibre (opengeos/GeoLibre) maintains reliability across web, desktop, and mobile deployments through a meticulously structured testing architecture. This article examines how the project validates code quality from low-level core libraries through full end-to-end user workflows.

Front-End Testing with Node's Native Test Runner

The TypeScript/React front-end relies on Node.js's built-in test runner rather than external frameworks like Jest or Vitest.

Test Organization and Execution

Test files reside in the tests/ directory and follow the *.test.ts naming convention. A representative example is tests/vector-layer-sync.test.ts, which validates synchronization behavior for vector map layers.

Run the front-end suite with:

npm run test:frontend

Coverage Thresholds and Enforcement

GeoLibre enforces strict coverage floors that must pass in CI:

Metric Threshold
Line coverage ≥ 78%
Branch coverage ≥ 78%
Function coverage ≥ 63%

Execute coverage-validated tests using:

npm run test:frontend:coverage

These thresholds are defined in package.json and block merges that would degrade test quality.

Python Back-End Testing with Pytest

The FastAPI sidecar in backend/geolibre_server/ uses Pytest for unit and integration validation.

Test Structure

Python tests live in backend/geolibre_server/tests/*.py. For example, backend/geolibre_server/tests/test_vector.py exercises vector data operations and API endpoints.

Run the Python suite independently:

npm run test:backend

Or invoke Pytest directly from the backend/ directory.

Back-End Coverage Requirements

The Python test suite must maintain > 55% coverage, verified through:

npm run test:backend:coverage

This lower threshold relative to the front-end reflects the back-end's narrower scope—focused on data processing APIs rather than complex UI state management.

End-to-End Testing with Playwright

E2E validation bridges front-end and back-end components using @playwright/test.

The e2e/ directory contains Playwright specifications that drive a fully built application. The test command orchestrates this process:

npm run test:e2e

This script:

  1. Builds the web application with Vite
  2. Serves it via vite preview
  3. Executes browser automation tests against the running instance

E2E tests verify critical user paths: map layer creation, data import workflows, visualization rendering, and cross-component data flow.

Type Safety and Build Verification

GeoLibre treats type correctness as a first-class quality gate. The npm run typecheck command runs:

tsc -b

This performs a full TypeScript compilation across all workspace packages without emitting artifacts, catching type mismatches that unit tests might miss.

The Vite build system validates bundling integrity, ensuring production artifacts compile without errors.

Continuous Integration Pipeline

The npm run ci command executes the complete validation pipeline:

  1. Full TypeScript build and type check
  2. Front-end unit tests with coverage enforcement
  3. Back-end Pytest suite with coverage enforcement
  4. Rust component check (npm run check:rust)

Security Auditing

A separate audit job runs npm run audit:ci, which executes:

  • npm audit for JavaScript dependency vulnerabilities
  • pip-audit for Python package security advisories

Rust Component Validation

The Tauri desktop client includes native Rust code. The npm run check:rust script runs cargo check to verify crate compilation, preventing native code regressions from reaching main.

Test Organization by Feature Area

GeoLibre's test files are granularly organized by functional domain:

  • Vector layer operations (tests/vector-layer-sync.test.ts)
  • Raster processing pipelines
  • UI profile configurations
  • Plugin system behavior
  • Time-slider components

This structure enables targeted test execution during development and rapid regression identification in CI failures.

Key Configuration Files

File Purpose
package.json Central command definitions, coverage thresholds, script orchestration
tests/*.test.ts Front-end test suite (>300 test files)
backend/geolibre_server/tests/*.py Python FastAPI validation
e2e/ Playwright end-to-end specifications
.github/workflows/ci.yml GitHub Actions workflow automation
README.md — Commands section Human-readable test command reference

Summary

  • GeoLibre testing strategy spans five layers: front-end unit, back-end unit, E2E automation, type checking, and CI orchestration
  • Coverage gates enforce 78%/78%/63% (line/branch/function) for TypeScript and >55% for Python
  • Cross-language validation ensures independent component health before integration verification
  • Security auditing runs automatically via npm run audit:ci with both npm and pip vulnerability scanning
  • Rust checks maintain native code quality for the Tauri desktop application
  • All commands are centralized in package.json with comprehensive documentation in the repository README

Frequently Asked Questions

What test frameworks does GeoLibre use?

GeoLibre uses Node's built-in test runner with TypeScript (via tsx) for front-end code, Pytest for Python back-end validation, and Playwright for end-to-end browser automation. This framework selection minimizes external dependencies while leveraging native platform capabilities.

How do I run the full test suite locally?

Execute npm run ci to run the complete pipeline: type checking, front-end tests with coverage, back-end tests with coverage, and Rust validation. For targeted development, use npm run test:frontend, npm run test:backend, or npm run test:e2e individually.

What are the minimum code coverage requirements?

Front-end code must achieve ≥78% line and branch coverage and ≥63% function coverage. The Python back-end must maintain >55% coverage. These thresholds are enforced in CI and defined in package.json.

Where are the test files located in the repository?

Front-end tests reside in tests/*.test.ts, Python tests in backend/geolibre_server/tests/*.py, and E2E tests in the e2e/ directory. The repository contains over 300 front-end test files covering UI components, map layers, plugins, and processing tools.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →