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
620ddcca 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)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
| Engine | Pass | Fail | Skip | Share |
|---|---|---|---|---|
| Chromium | 2,073 | 0 | 2 | |
| Firefox | 2,056 | 0 | 19 | |
| WebKit | 2,053 | 0 | 22 |
Coverage
- 77.5%Lines
- 69.2%Branches
- 69.6%Functions
- 75.3%Statements
By package
| Package | Tests | Lines | Branches | Functions | Statements | Test : source | Failing |
|---|---|---|---|---|---|---|---|
@ogygia/bake | 33 | 88.4% | 69.6% | 86.8% | 87.1% | 0.86 | 0 |
@ogygia/barrels | 94 | 97.5% | 84.4% | 92.5% | 96.2% | 2.77 | 0 |
@ogygia/cli | 57 | 51.7% | 47.2% | 58.3% | 52.2% | 0.43 | 0 |
@ogygia/compiler | 2,212 | 97.9% | 89.2% | 97.1% | 96.2% | 1.43 | 0 |
@ogygia/content | 736 | 92.6% | 81.0% | 86.3% | 90.3% | 0.86 | 0 |
@ogygia/core | 2,801 | 90.7% | 80.4% | 85.1% | 88.5% | 1.40 | 0 |
@ogygia/data-shake | 212 | 94.1% | 83.2% | 95.7% | 91.3% | 1.27 | 0 |
@ogygia/devtools | 925 | 59.6% | 52.8% | 46.0% | 56.9% | 0.41 | 0 |
@ogygia/federation | 228 | 91.9% | 81.8% | 84.3% | 88.9% | 1.58 | 0 |
@ogygia/flags | 74 | 93.8% | 82.3% | 90.2% | 92.0% | 1.06 | 0 |
@ogygia/insights | 130 | 79.0% | 68.3% | 74.3% | 75.8% | 0.61 | 0 |
@ogygia/jumpstart | 34 | 89.9% | 88.9% | 71.8% | 89.8% | 1.98 | 0 |
@ogygia/machine | 1,082 | 96.8% | 94.3% | 91.3% | 96.3% | 1.59 | 0 |
@ogygia/postrender | 157 | 93.1% | 83.8% | 89.2% | 92.4% | 1.66 | 0 |
@ogygia/rewrite | 155 | 94.8% | 88.7% | 89.7% | 93.3% | 0.90 | 0 |
@ogygia/router | 137 | 95.2% | 82.2% | 91.2% | 92.6% | 1.02 | 0 |
@ogygia/testing | 40 | 74.0% | 69.4% | 61.2% | 73.1% | 0.79 | 0 |
@ogygia/tooling | 48 | 28.2% | 24.1% | 24.4% | 27.1% | 0.36 | 0 |
docs | 11 | – | – | – | – | – | 0 |
palaestra | 358 | – | – | – | – | – | 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
| Package | Comments left | New ones fail the build |
|---|---|---|
devtools | 3,765 | not yet |
core | 1,648 | yes |
content | 430 | not yet |
insights | 358 | not yet |
cli | 266 | not yet |
machine | 223 | not yet |
federation | 200 | not yet |
postrender | 182 | not yet |
rewrite | 148 | not yet |
tooling | 126 | not yet |
flags | 71 | not yet |
testing | 59 | not yet |
config | 58 | not yet |
bake | 44 | not yet |
barrels | 35 | not yet |
router | 24 | not yet |
ogygia | 5 | not yet |
tsdown-plugin-svelte | 1 | not yet |
compiler | 0 | yes |
data-shake | 0 | not yet |
jumpstart | 0 | not yet |
Where each suite runs
| Suite | Node | Chromium | Firefox | WebKit | Firefox (release) |
|---|---|---|---|---|---|
unit tests | runs | – | – | – | – |
packages/content browser tests | – | runs | runs | runs | runs |
packages/core browser tests | – | runs | runs | runs | runs |
packages/machine browser tests | – | runs | runs | runs | runs |
packages/rewrite browser tests | – | runs | – | – | – |
apps/docs e2e | – | runs | runs | runs | – |
apps/palaestra e2e | – | runs | runs | runs | – |
packages/content e2e | – | runs | runs | runs | – |
packages/devtools e2e | – | runs | runs | runs | – |
packages/federation e2e | – | runs | runs | runs | – |
packages/jumpstart e2e | – | runs | runs | runs | – |
packages/postrender e2e | – | runs | runs | runs | – |
packages/rewrite e2e | – | runs | runs | runs | – |
packages/router e2e | – | runs | runs | runs | – |
packages/testing e2e | – | runs | runs | runs | – |
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.