Tests / @ogygia/postrender

@ogygia/postrender

Version 0.13.1
commit 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

TestKindNodeChromiumFirefoxWebKit
packages/postrender/test/handle.test.ts
a missing postrender.handle() > falls back to the memory store and warns once, naming the fix (dev)Unitpassnot runnot runnot run
a missing postrender.handle() > falls back to the memory store and warns once, naming the fix (production)Unitpassnot runnot runnot run
Kit’s `config` decides eligibility > `config.postrender: false` on the route turns the read path off (default on)Unitpassnot runnot runnot run
Kit’s `config` decides eligibility > `config.postrender: true` turns it on when the app-wide default is offUnitpassnot runnot runnot run
Kit’s `config` decides eligibility > a value that is not a boolean warns once and leaves the default in chargeUnitpassnot runnot runnot run
postrender.handle() — settings reach the read path through the request > invalidate reaches the store the handle was given, with no configure stepUnitpassnot runnot runnot run
postrender.handle() — settings reach the read path through the request > returns a Kit handle that resolves; its store answers the request it sawUnitpassnot runnot runnot 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)Unitpassnot runnot runnot run
postrender.handle() after ogygia.handle() > dev: the read path throws a clear error naming the fixUnitpassnot runnot runnot run
postrender.handle() after ogygia.handle() > production: warns once and still serves from the handle’s storeUnitpassnot runnot runnot run
the TTL backstop on read > a page older than the ttl is a miss, even from a store that never expires itUnitpassnot runnot runnot 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 surviveUnitpassnot runnot runnot run
postrender memory store is byte-bounded > redirects are cheap entries: a thousand of them fitUnitpassnot runnot runnot run
packages/postrender/test/plugin.test.ts
postrender() — the vite value > its build hook claims the `postrender` key inside Kit’s `config`Unitpassnot runnot runnot run
postrender() — the vite value > names the package and normalizes its optionsUnitpassnot runnot runnot run
the server realm, started > a page written after a publish evicted it is never served while it is taken back outUnitpassnot runnot runnot run
the server realm, started > a POST evicts its page before its response goes out: the GET right after renders fresh (#283)#283Unitpassnot runnot runnot run
the server realm, started > an invalidation announces what it dropped through the shared `invalidated` hookUnitpassnot runnot runnot run
the server realm, started > answers `lastBuild`: nothing the first time, the previous build after thatUnitpassnot runnot runnot run
the server realm, started > remembers the build past the pages’ TTL: a deploy a month later still finds itUnitpassnot runnot runnot run
packages/postrender/test/postrender-esi.test.ts
postrender/stitch — esi_rewrite > balances NESTED regions inside an edge hole (a fallback can contain regions)Unitpassnot runnot runnot run
postrender/stitch — esi_rewrite > leaves serve holes and plain html untouchedUnitpassnot runnot runnot run
postrender/stitch — esi_rewrite > resolves a PAGE-RELATIVE endpoint (Kit relative paths) to an absolute include srcUnitpassnot runnot runnot run
postrender/stitch — esi_rewrite > rewrites only the edge holes on a mixed page (serve taints at the capture, not here)Unitpassnot runnot runnot run
postrender/stitch — esi_rewrite > wraps an edge hole in esi:remove and follows it with an esi:include of its capabilityUnitpassnot runnot runnot run
postrender/stitch — modes > reads the mode off the attribute; a bare `stitch` (older emit) is serveUnitpassnot runnot runnot run
postrender/stitch — modes > stitch_modes: none / edge-only / serve taintsUnitpassnot runnot runnot 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 stampingUnitpassnot runnot runnot run
cloudflare KV store > round-trips, prefix-evicts, and runs the sentinel-key tag indexUnitpassnot runnot runnot run
invalidate(fn, args) — the reverse index > evicts exactly the consuming keys and purges them at every edgeUnitpassnot runnot runnot run
invalidate(fn, args) — the reverse index > throws the macro-law error on an unstamped functionUnitpassnot runnot runnot run
upstash store (REST command shapes) > a root prefix scans every keyUnitpassnot runnot runnot run
upstash store (REST command shapes) > only ever extends a tag set’s expiryUnitpassnot runnot runnot run
upstash store (REST command shapes) > speaks the REST protocol: SET EX, SADD/EXPIRE tags, SMEMBERS+DEL on evictByTagUnitpassnot runnot runnot run
packages/postrender/test/postrender.test.ts
edge adapters > akamai: EdgeGrid-signed Fast Purge by url + prefix tag; headers stamp prefix tagsUnitpassnot runnot runnot run
edge adapters > cloudfront: SigV4-signed CreateInvalidation; prefix becomes path + wildcardUnitpassnot runnot runnot run
postrender/key > key is the pathname, verbatim (trailing slash preserved)Unitpassnot runnot runnot run
postrender/key > normalize_prefix enforces the leading slash and strips trailing ones (root survives)Unitpassnot runnot runnot run
postrender/key > prefix_tags is depth-cappedUnitpassnot runnot runnot run
postrender/observe > a cookie WRITE disqualifiesUnitpassnot runnot runnot run
postrender/observe > a NON-default cookie read disqualifies, namedUnitpassnot runnot runnot run
postrender/observe > a populated locals read disqualifies, namedUnitpassnot runnot runnot run
postrender/observe > a reason already on the facts (a flag read) is what the observation reportsUnitpassnot runnot runnot run
postrender/observe > default-valued reads still store (the canonical render)Unitpassnot runnot runnot run
postrender/observe > personalization headers disqualify; delivery plumbing does notUnitpassnot runnot runnot run
postrender/observe > the reason lands in the request facts (perVisitor); the first one winsUnitpassnot runnot runnot run
postrender/registry > a store that throws is reported as the store, and the rest of the invalidation still runsUnitpassnot runnot runnot run
postrender/registry > invalidate fans out to store + every edge; one edge down never throwsUnitpassnot runnot runnot run
postrender/registry > single-flight: a flight settles once, and a late settle never ends a newer flight (#194)#194Unitpassnot runnot runnot run
postrender/registry > single-flight: an invalidation ends the flights of the pages it evicts, and only those (#194)#194Unitpassnot runnot runnot run
postrender/registry > single-flight: joiners see the first render’s outcomeUnitpassnot runnot runnot 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 flightUnitpassnot runnot runnot run
postrender/registry > store failures never throw through store_get/putUnitpassnot runnot runnot run
postrender/registry > the latest handle made is the server’s runtime; none made is the memory defaultUnitpassnot runnot runnot run
postrender/registry > warns ONCE when edges are configured over the per-instance memory defaultUnitpassnot runnot runnot run
postrender/stitch > FAIL-OPEN: a null/throwing render keeps that hole verbatim, others still spliceUnitpassnot runnot runnot run
postrender/stitch > finds top-level stitch holes, unescaping the endpointUnitpassnot runnot runnot run
postrender/stitch > handles NESTED regions inside the fallback (balanced, not lazy)Unitpassnot runnot runnot run
postrender/stitch > ignores unmarked regionsUnitpassnot runnot runnot run
postrender/stitch > splices renders in place; nested islands land under a neutral display:contents divUnitpassnot runnot runnot run
store contract: memory (tier 1) > evict removes exactly one keyUnitpassnot runnot runnot run
store contract: memory (tier 1) > evictWhere at the root clears every key (the deploy thaw)Unitpassnot runnot runnot run
store contract: memory (tier 1) > evictWhere removes the subtree and never a lookalike siblingUnitpassnot runnot runnot run
store contract: memory (tier 1) > misses on unknown keysUnitpassnot runnot runnot run
store contract: memory (tier 1) > round-trips a page entryUnitpassnot runnot runnot run
store contract: memory (tier 1) > round-trips a redirect entryUnitpassnot runnot runnot run
store contract: memory (tier 1) > TTL backstop: an expired entry is a missUnitpassnot runnot runnot run
store contract: valkey (fake client) > evict removes exactly one keyUnitpassnot runnot runnot run
store contract: valkey (fake client) > evictWhere at the root clears every key (the deploy thaw)Unitpassnot runnot runnot run
store contract: valkey (fake client) > evictWhere removes the subtree and never a lookalike siblingUnitpassnot runnot runnot run
store contract: valkey (fake client) > misses on unknown keysUnitpassnot runnot runnot run
store contract: valkey (fake client) > round-trips a page entryUnitpassnot runnot runnot run
store contract: valkey (fake client) > round-trips a redirect entryUnitpassnot runnot runnot run
store contract: valkey (fake client) > TTL backstop: an expired entry is a missUnitpassnot runnot runnot run
store contract: valkey (REAL server via REDIS_URL) > runs the shared contractUnitskipnot runnot runnot run
valkey tag index lifetime > a longer-lived entry extends the tag setUnitpassnot runnot runnot run
valkey tag index lifetime > a short-lived entry never shortens the tag set of a long-lived oneUnitpassnot runnot runnot run
packages/postrender/test/sim.test.ts
postrender, simulated > renders a stampede once, never serves a page from before a publish or a postUnitpassnot runnot runnot 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 streakUnitpassnot runnot runnot run
a store that is down > never fails a render, and is said once per failing streak, with the errorUnitpassnot runnot runnot run