Tests / @ogygia/postrender
@ogygia/postrender
Version 0.13.1
4b18f465 80 test runs (80 tests, each run in Node, the browsers or both)
1.24× lines of test for each line of source (2,791 to 2,259) 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)89.4% of source lines run by the tests
- 80Unit
- 0Browser
- 0End to end
- 0Type tests
- 0Lint rules
- 0Failing
Coverage
- 89.4%Lines
- 72.9%Branches
- 83.7%Functions
- 87.5%Statements
Every test
End-to-end suites are not part of this report yet.
80 tests
| Test | Kind | Node | Chromium | Firefox | WebKit |
|---|---|---|---|---|---|
packages/postrender/test/handle.test.ts | |||||
| a missing postrender.handle() > falls back to the memory store and warns once, naming the fix (dev) | Unit | pass | not run | not run | not run |
| a missing postrender.handle() > falls back to the memory store and warns once, naming the fix (production) | Unit | pass | not run | not run | not run |
| Kit’s `config` decides eligibility > `config.postrender: false` on the route turns the read path off (default on) | Unit | pass | not run | not run | not run |
| Kit’s `config` decides eligibility > `config.postrender: true` turns it on when the app-wide default is off | Unit | pass | not run | not run | not run |
| Kit’s `config` decides eligibility > a value that is not a boolean warns once and leaves the default in charge | Unit | pass | not run | not run | not run |
| postrender.handle() — settings reach the read path through the request > invalidate reaches the store the handle was given, with no configure step | Unit | pass | not run | not run | not run |
| postrender.handle() — settings reach the read path through the request > returns a Kit handle that resolves; its store answers the request it saw | Unit | pass | not run | not run | not run |
| postrender.handle() — settings reach the read path through the request > warns once when vite.config does not list postrender() (the server half never started) | Unit | pass | not run | not run | not run |
| postrender.handle() after ogygia.handle() > dev: the read path throws a clear error naming the fix | Unit | pass | not run | not run | not run |
| postrender.handle() after ogygia.handle() > production: warns once and still serves from the handle’s store | Unit | pass | not run | not run | not run |
| the TTL backstop on read > a page older than the ttl is a miss, even from a store that never expires it | Unit | pass | not run | not run | not run |
packages/postrender/test/memory-store.test.ts | |||||
| postrender memory store is byte-bounded > a run of multi-MB pages stays under the budget; the newest survive | Unit | pass | not run | not run | not run |
| postrender memory store is byte-bounded > redirects are cheap entries: a thousand of them fit | Unit | pass | not run | not run | not run |
packages/postrender/test/plugin.test.ts | |||||
| postrender() — the vite value > its build hook claims the `postrender` key inside Kit’s `config` | Unit | pass | not run | not run | not run |
| postrender() — the vite value > names the package and normalizes its options | Unit | pass | not run | not run | not run |
| the server realm, started > a page written after a publish evicted it is never served while it is taken back out | Unit | pass | not run | not run | not run |
| the server realm, started > a POST evicts its page before its response goes out: the GET right after renders fresh (#283)#283 | Unit | pass | not run | not run | not run |
| the server realm, started > an invalidation announces what it dropped through the shared `invalidated` hook | Unit | pass | not run | not run | not run |
| the server realm, started > answers `lastBuild`: nothing the first time, the previous build after that | Unit | pass | not run | not run | not run |
| the server realm, started > remembers the build past the pages’ TTL: a deploy a month later still finds it | Unit | pass | not run | not run | not run |
packages/postrender/test/postrender-esi.test.ts | |||||
| postrender/stitch — esi_rewrite > balances NESTED regions inside an edge hole (a fallback can contain regions) | Unit | pass | not run | not run | not run |
| postrender/stitch — esi_rewrite > leaves serve holes and plain html untouched | Unit | pass | not run | not run | not run |
| postrender/stitch — esi_rewrite > resolves a PAGE-RELATIVE endpoint (Kit relative paths) to an absolute include src | Unit | pass | not run | not run | not run |
| postrender/stitch — esi_rewrite > rewrites only the edge holes on a mixed page (serve taints at the capture, not here) | Unit | pass | not run | not run | not run |
| postrender/stitch — esi_rewrite > wraps an edge hole in esi:remove and follows it with an esi:include of its capability | Unit | pass | not run | not run | not run |
| postrender/stitch — modes > reads the mode off the attribute; a bare `stitch` (older emit) is serve | Unit | pass | not run | not run | not run |
| postrender/stitch — modes > stitch_modes: none / edge-only / serve taints | Unit | pass | not run | not run | not run |
packages/postrender/test/postrender-sources-and-adapters.test.ts | |||||
| cloudflare edge adapter > bearer-authed zone purge: files for urls, prefixes for subtrees; cache-tag stamping | Unit | pass | not run | not run | not run |
| cloudflare KV store > round-trips, prefix-evicts, and runs the sentinel-key tag index | Unit | pass | not run | not run | not run |
| invalidate(fn, args) — the reverse index > evicts exactly the consuming keys and purges them at every edge | Unit | pass | not run | not run | not run |
| invalidate(fn, args) — the reverse index > throws the macro-law error on an unstamped function | Unit | pass | not run | not run | not run |
| upstash store (REST command shapes) > a root prefix scans every key | Unit | pass | not run | not run | not run |
| upstash store (REST command shapes) > only ever extends a tag set’s expiry | Unit | pass | not run | not run | not run |
| upstash store (REST command shapes) > speaks the REST protocol: SET EX, SADD/EXPIRE tags, SMEMBERS+DEL on evictByTag | Unit | pass | not run | not run | not run |
packages/postrender/test/postrender.test.ts | |||||
| edge adapters > akamai: EdgeGrid-signed Fast Purge by url + prefix tag; headers stamp prefix tags | Unit | pass | not run | not run | not run |
| edge adapters > cloudfront: SigV4-signed CreateInvalidation; prefix becomes path + wildcard | Unit | pass | not run | not run | not run |
| postrender/key > key is the pathname, verbatim (trailing slash preserved) | Unit | pass | not run | not run | not run |
| postrender/key > normalize_prefix enforces the leading slash and strips trailing ones (root survives) | Unit | pass | not run | not run | not run |
| postrender/key > prefix_tags is depth-capped | Unit | pass | not run | not run | not run |
| postrender/observe > a cookie WRITE disqualifies | Unit | pass | not run | not run | not run |
| postrender/observe > a NON-default cookie read disqualifies, named | Unit | pass | not run | not run | not run |
| postrender/observe > a populated locals read disqualifies, named | Unit | pass | not run | not run | not run |
| postrender/observe > a reason already on the facts (a flag read) is what the observation reports | Unit | pass | not run | not run | not run |
| postrender/observe > default-valued reads still store (the canonical render) | Unit | pass | not run | not run | not run |
| postrender/observe > personalization headers disqualify; delivery plumbing does not | Unit | pass | not run | not run | not run |
| postrender/observe > the reason lands in the request facts (perVisitor); the first one wins | Unit | pass | not run | not run | not run |
| postrender/registry > a store that throws is reported as the store, and the rest of the invalidation still runs | Unit | pass | not run | not run | not run |
| postrender/registry > invalidate fans out to store + every edge; one edge down never throws | Unit | pass | not run | not run | not run |
| postrender/registry > single-flight: a flight settles once, and a late settle never ends a newer flight (#194)#194 | Unit | pass | not run | not run | not run |
| postrender/registry > single-flight: an invalidation ends the flights of the pages it evicts, and only those (#194)#194 | Unit | pass | not run | not run | not run |
| postrender/registry > single-flight: joiners see the first render’s outcome | Unit | pass | not run | not run | not run |
| postrender/registry > single-flight: the requests waiting on a render an invalidation ended are let go at once, and the next one opens a new flight | Unit | pass | not run | not run | not run |
| postrender/registry > store failures never throw through store_get/put | Unit | pass | not run | not run | not run |
| postrender/registry > the latest handle made is the server’s runtime; none made is the memory default | Unit | pass | not run | not run | not run |
| postrender/registry > warns ONCE when edges are configured over the per-instance memory default | Unit | pass | not run | not run | not run |
| postrender/stitch > FAIL-OPEN: a null/throwing render keeps that hole verbatim, others still splice | Unit | pass | not run | not run | not run |
| postrender/stitch > finds top-level stitch holes, unescaping the endpoint | Unit | pass | not run | not run | not run |
| postrender/stitch > handles NESTED regions inside the fallback (balanced, not lazy) | Unit | pass | not run | not run | not run |
| postrender/stitch > ignores unmarked regions | Unit | pass | not run | not run | not run |
| postrender/stitch > splices renders in place; nested islands land under a neutral display:contents div | Unit | pass | not run | not run | not run |
| store contract: memory (tier 1) > evict removes exactly one key | Unit | pass | not run | not run | not run |
| store contract: memory (tier 1) > evictWhere at the root clears every key (the deploy thaw) | Unit | pass | not run | not run | not run |
| store contract: memory (tier 1) > evictWhere removes the subtree and never a lookalike sibling | Unit | pass | not run | not run | not run |
| store contract: memory (tier 1) > misses on unknown keys | Unit | pass | not run | not run | not run |
| store contract: memory (tier 1) > round-trips a page entry | Unit | pass | not run | not run | not run |
| store contract: memory (tier 1) > round-trips a redirect entry | Unit | pass | not run | not run | not run |
| store contract: memory (tier 1) > TTL backstop: an expired entry is a miss | Unit | pass | not run | not run | not run |
| store contract: valkey (fake client) > evict removes exactly one key | Unit | pass | not run | not run | not run |
| store contract: valkey (fake client) > evictWhere at the root clears every key (the deploy thaw) | Unit | pass | not run | not run | not run |
| store contract: valkey (fake client) > evictWhere removes the subtree and never a lookalike sibling | Unit | pass | not run | not run | not run |
| store contract: valkey (fake client) > misses on unknown keys | Unit | pass | not run | not run | not run |
| store contract: valkey (fake client) > round-trips a page entry | Unit | pass | not run | not run | not run |
| store contract: valkey (fake client) > round-trips a redirect entry | Unit | pass | not run | not run | not run |
| store contract: valkey (fake client) > TTL backstop: an expired entry is a miss | Unit | pass | not run | not run | not run |
| store contract: valkey (REAL server via REDIS_URL) > runs the shared contract | Unit | skip | not run | not run | not run |
| valkey tag index lifetime > a longer-lived entry extends the tag set | Unit | pass | not run | not run | not run |
| valkey tag index lifetime > a short-lived entry never shortens the tag set of a long-lived one | Unit | pass | not run | not run | not run |
packages/postrender/test/sim.test.ts | |||||
| postrender, simulated > renders a stampede once, never serves a page from before a publish or a post | Unit | pass | not run | not run | not run |
packages/postrender/test/store-failed.test.ts | |||||
| a store that is down > a call that started before the outage and answers after it does not end the streak | Unit | pass | not run | not run | not run |
| a store that is down > never fails a render, and is said once per failing streak, with the error | Unit | pass | not run | not run | not run |