Tests

How ogygia is tested

Every number here comes from the CI run that built ogygia 0.14.0. Tests run in real browsers against real builds, and every bug fix starts with a test that failed first.

Version 0.14.0 latest
commit 620ddcca
9,524 tests in this release
1.02× lines of test for each line of source (164,868 to 162,428) Only real test code counts: test files and their helpers, not fixtures, sample apps or benches. Blank lines are left out on both sides.
Exactly what is counted non-blank lines of test code across the repo (*.test.ts, *.test-d.ts, *.spec.ts, and the .ts helpers in test/ and e2e/ folders; no fixtures, fixture apps, stubs or benches), over non-blank lines of packages/*/src (no .d.ts or generated files)
77.5% of source lines run by the tests

By kind

  • 7,444Unit
  • 1,599Browser
  • 464End to end
  • 0Type tests
  • 17Lint rules
  • 408Regression tests, each citing an issue
  • 679Seeded race simulations
  • 263Step-count benches
  • 0Failing

By browser engine

Browser and end-to-end tests, run once in each engine.
EnginePassFailSkipShare
Chromium2,07302
Firefox2,056019
WebKit2,053022

Coverage

  • 77.5%Lines
  • 69.2%Branches
  • 69.6%Functions
  • 75.3%Statements

By package

Pick a package to see each of its tests and its result in each engine.
PackageTestsLinesBranchesFunctionsStatementsTest : sourceFailing
@ogygia/bake3388.4%69.6%86.8%87.1%0.860
@ogygia/barrels9497.5%84.4%92.5%96.2%2.770
@ogygia/cli5751.7%47.2%58.3%52.2%0.430
@ogygia/compiler2,21297.9%89.2%97.1%96.2%1.430
@ogygia/content73692.6%81.0%86.3%90.3%0.860
@ogygia/core2,80190.7%80.4%85.1%88.5%1.400
@ogygia/data-shake21294.1%83.2%95.7%91.3%1.270
@ogygia/devtools92559.6%52.8%46.0%56.9%0.410
@ogygia/federation22891.9%81.8%84.3%88.9%1.580
@ogygia/flags7493.8%82.3%90.2%92.0%1.060
@ogygia/insights13079.0%68.3%74.3%75.8%0.610
@ogygia/jumpstart3489.9%88.9%71.8%89.8%1.980
@ogygia/machine1,08296.8%94.3%91.3%96.3%1.590
@ogygia/postrender15793.1%83.8%89.2%92.4%1.660
@ogygia/rewrite15594.8%88.7%89.7%93.3%0.900
@ogygia/router13795.2%82.2%91.2%92.6%1.020
@ogygia/testing4074.0%69.4%61.2%73.1%0.790
@ogygia/tooling4828.2%24.1%24.4%27.1%0.360
docs11–––––0
palaestra358–––––0

Beyond the tests

Tests check what someone thought to ask. These checks go looking for what nobody thought of: random apps, failures made to happen on purpose, and bugs planted to see if they get caught. Every number is counted from the code at this commit. Each one links to the file that explains it.

Region

  • 8,623,104 server cases: every combination of its inputs Region is the core of ogygia. Each kind of region (an island, a hole, a lake, a held value, a promise, nothing) has its inputs as axes. Every combination of their values renders at every place in the page, in dev and production, with Svelte’s async compile on and off. No pairwise cut, no sampling. packages/core/test/_region-grid-axes.ts
  • 775,040 browser cases, in each of Chromium, Firefox and WebKit The same inputs created fresh in the browser (465,024) and hydrated over their own server HTML (310,016). Every pull request runs the whole grid, cut into 4 parts, in each engine. packages/core/test/browser/_region-grid-client.ts
  • 256 snapshot files One file per kind and place in the page, the whole grid. A change to any byte of any case shows in review, by name. packages/core/test/__snapshots__/region-grid
  • 228,570 distinct outputs, each stored in full Each file writes out every distinct output (head, body, tail, console and the rest) in full, with the exact cases that give it. A combination Region refuses is an output too: its coded error. packages/core/test/_region-grid-report.ts
  • 6 fuzz properties (5 on the server, 1 in the browser) Random inputs, with odd text in every text prop and props a kind never reads. Each must render good HTML, throw only a coded refusal, and hydrate with nothing thrown away. On every pull request each server property tries 2,000 inputs and each browser one 600 per engine, from a fixed seed, so a failure replays. packages/core/test/region-grid-fuzz.test.ts
  • 100,000 inputs each fuzz property tries every night Every night the whole grid runs in Chromium, Firefox and WebKit, then the fuzz runs at length. .github/workflows/dst.yml
  • 240 of 240 planted bugs in Region, each caught or proved harmless A mutant (a small planted bug) is put in Region.svelte, one at a time, and the whole core suite runs. 219 were caught by a test, and the file names the first one that failed. 21 change nothing anyone can see, each with its reason, so each is code we can delete. packages/core/test/region-mutants.json
  • 124 of 128 branches of Region.svelte run by the tests (96.9%) A branch is one way through an if, a ?: or an &&. Counted by this report’s own coverage run, in Node and Chromium. packages/core/src/Region.svelte

Simulation

  • 196 of 196 state machine steps accounted for Each part of ogygia that changes state is a state machine (a list of allowed moves). Every move is reached by the simulator (166) or checked by a named test (30). internal/sim/src/steps.ts
  • 917 of 1,832 places that can fail, each handled on purpose A place where code can fail is made to fail by the simulator (39), checked by a test (863), or proved it cannot fail (4), or shown that breaking it changes nothing (11). The other 915 are listed and wait their turn; that list may only shrink. internal/sim/src/failures.ts
  • 32 of 39 made-to-fail places whose recovery is proved We break the recovery code on purpose. When the simulator notices the break, we know the recovery is really checked. internal/sim/failures.json
  • 50 of 57 planted bugs caught in the last daily run (2026-11-16) A mutant (a small planted bug) is put in the code, one at a time, and the simulator must catch it. By package: core 40, federation 19, rewrite 38. Mutants that change nothing a run can see are left out. internal/sim/mutants.json
  • 21 fault switches in the source A buggify point (a built-in fault switch) lets the simulator make a real failure happen, like a lost download. Switches never ship to users. internal/notes/dst.md
  • 36 shapes random test apps are built from The simulator writes whole apps from a seed, mixing these shapes. Each sweep runs 8 apps, the same way every time. internal/sim/src/gen.ts

Compiler simulation

  • 7 compiler oracles An oracle (a rule every answer must follow) judges the compiler. For example: two cold builds of one app must agree, and a dev server must serve what a fresh start would. internal/compiler-dst/package.json
  • 400 random apps compiled on every CI run Each app is drawn at random, then compiled cold and in random orders. A failure prints the smallest app that still breaks. internal/compiler-dst/test

Fuzzing

  • 24 HTML readers checked against a real parser (8 files) ogygia reads HTML with small, fast scanners. Fuzzing (feeding in odd, random input) checks each answer against the parser browsers follow. internal/html-fuzz/README.md
  • 91 property tests (53 files) A property test says what must always be true, then tries many random inputs. A failure prints its seed, so it can be replayed exactly. internal/html-fuzz/README.md

Speed

  • 263 step-count benches (39 files) Heisenbench counts the exact steps code takes instead of timing it. The count is the same on any machine, so a slowdown cannot hide. internal/heisenbench/README.md
  • 3,931 of 11,129 functions with something that measures them A bench or a replayable test measures each one. 1,705 more are written up as needing no measure, each with its reason. A new function with neither fails its pull request. internal/heisenbench/src/unmeasured.ts

Rules as code

  • 18 runtime rules A rule like "a region is never mounted twice" is code, not a comment. It runs in dev and at the end of every end-to-end test. packages/core/src/rules.ts
  • 39 lint rules (18 written for ogygia) A lint rule (a check that reads the code) stops a known mistake before the code runs. .oxlintrc.json
  • 21 invariants, with 62 enforcers An invariant is a promise that must always hold. Each one names the rules and tests that enforce it, and a check makes sure they exist. internal/notes/INVARIANTS.md

Comments become tests

  • 7,643 comments still to turn into tests A comment that says "this must never happen" is a wish. Each one is moved into a test, rule or type that fails when it stops being true. internal/checks/comments.ts
  • 2 of 21 packages where a new free comment fails the build Once a package is done, the lint rule turns on as an error there, so free comments cannot creep back. .oxlintrc.json
Comments still to turn into tests, by package
Counted by internal/checks/comments.ts in each package's source.
PackageComments leftNew ones fail the build
devtools3,765not yet
core1,648yes
content430not yet
insights358not yet
cli266not yet
machine223not yet
federation200not yet
postrender182not yet
rewrite148not yet
tooling126not yet
flags71not yet
testing59not yet
config58not yet
bake44not yet
barrels35not yet
router24not yet
ogygia5not yet
tsdown-plugin-svelte1not yet
compiler0yes
data-shake0not yet
jumpstart0not yet

Where each suite runs

The engines CI runs each suite in, read from .github/scripts/ci-plan.ts. WebKit is the engine behind Safari.
SuiteNodeChromiumFirefoxWebKitFirefox (release)
unit testsruns––––
packages/content browser tests–runsrunsrunsruns
packages/core browser tests–runsrunsrunsruns
packages/machine browser tests–runsrunsrunsruns
packages/rewrite browser tests–runs–––
apps/docs e2e–runsrunsruns–
apps/palaestra e2e–runsrunsruns–
packages/content e2e–runsrunsruns–
packages/devtools e2e–runsrunsruns–
packages/federation e2e–runsrunsruns–
packages/jumpstart e2e–runsrunsruns–
packages/postrender e2e–runsrunsruns–
packages/rewrite e2e–runsrunsruns–
packages/router e2e–runsrunsruns–
packages/testing e2e–runsrunsruns–

How the testing works

Real browsers, real builds

Browser tests run in Chromium, Firefox and WebKit through Vitest browser mode. End-to-end tests build real fixture apps and drive them with Playwright. Nothing runs against a fake DOM when a real one can answer.

Races found by seeded simulation

Code that can race runs under a seeded scheduler that tries many orderings. Each ordering that breaks something becomes a test with its seed, so the same race is checked on every run.

Every bug is proved first

A fix lands as two commits: first a test that fails on the old code, then the fix. The test says the behavior in plain words and cites its issue. Those are the regression tests counted above.

Rules, not comments

A sentence like "this must never happen" is written as something that fails out loud: a runtime rule checked at the end of every end-to-end test, a type, a lint rule or a test. Lint rules have their own tests.

Speed is counted, not timed

Hot paths have benches that count exact steps instead of timing them, so a result does not depend on the machine. A new function on a hot path needs a bench.

Size has a budget

The JavaScript a page boots with is measured on every pull request against its base. Growth over half a percent has to say why before it can land.