Skip to content

Conformance fixtures

The conformance fixtures are language-agnostic test cases. Every Sightmap SDK port is expected to pass them. They live under conformance/ in the spec repo.

Each fixture is a numbered directory containing:

  • sightmap/ — input YAML files (the simulated .sightmap/ directory)
  • expected.json — list of { command, args, expected } test cases the runner checks

The runner asserts that every key in expected is present in the actual output and matches deeply. Extra keys in the actual output are allowed, so the suite is forward-compatible. For arrays in expected, the actual array must be at least as long, and the prefix must match.

Clone the spec repo, then point the official CLI at the conformance/ directory:

Terminal window
git clone https://github.com/sightmap/spec.git
cd spec
pnpx @sightmap/sightmap validate conformance

The @sightmap/sightmap package vendors the runner and reports per-fixture pass/fail. See @sightmap/sightmap on npm.

#NameExercises
001minimalSmallest valid sightmap; basic match
002multi-file-mergeSame view name across two files → merge-collision-view warning
003route-precedenceFirst-match-wins on * vs ** vs literal
004param-normalizationExpress-style :param normalizes to *
005selector-arrayselector accepts array; alternates tried in order
006view-scoped-vs-globalGlobal components match everywhere; scoped only on their view
007request-method-filtermatch filters requests by HTTP method

A second series (100-fmt-*) covers formatter behavior — quoting, key order, list sort, comment and header preservation, idempotence, and leaving invalid input untouched.

  1. Create the next-numbered directory under conformance/.
  2. Author sightmap/*.yaml and expected.json. Keep each fixture focused on one behavior.
  3. Run the conformance runner from any SDK to verify it passes.
  4. Open a PR. Sign off your commits with -s per the Contributing guide.
  • @sightmap/sightmap — clones this repo at a pinned SHA and runs the fixtures in CI.
  • Future ports (sightmap-python, sightmap-go) will run the same fixtures via a port-specific runner.