Tests / @ogygia/postrender
@ogygia/postrender
Version 0.14.0 latest
620ddcca 157 test runs (157 tests, each run in Node, the browsers or both)
1.66× lines of test for each line of source (3,868 to 2,327) 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)93.1% of source lines run by the tests
- 146Unit
- 0Browser
- 11End to end
- 0Type tests
- 0Lint rules
- 0Failing
Coverage
- 93.1%Lines
- 83.8%Branches
- 89.2%Functions
- 92.4%Statements
Every test
157 tests
| Test | Kind | Node | Chromium | Firefox | WebKit |
|---|---|---|---|---|---|
packages/postrender/e2e/postrender-dev.spec.ts | |||||
| a REFUSED page: no would-store, still re-renders (the named console note is dev-server-side) | End to end | not run | pass | pass | pass |
| an ELIGIBLE page renders EVERY time in dev (no store), flagged would-store | End to end | not run | pass | pass | pass |
| the right handle order says nothing | End to end | not run | pass | pass | pass |
packages/postrender/e2e/postrender-order.spec.ts | |||||
| dev, postrender.handle() AFTER ogygia.handle(): a page request is a clear error | End to end | not run | pass | pass | pass |
| production, no postrender.handle() at all: one warning, the memory store serves | End to end | not run | pass | pass | pass |
| production, postrender.handle() AFTER ogygia.handle(): one warning, pages still stored | End to end | not run | pass | pass | pass |
packages/postrender/e2e/postrender.spec.ts | |||||
| S20 a later plugin answers the flight’s request: the next cold request is not left waiting | End to end | not run | pass | pass | pass |
| S21 a publish lands while the page renders: the render is served, not stored | End to end | not run | pass | pass | pass |
| S22 a form post on another page while the page renders: the render is still stored | End to end | not run | pass | pass | pass |
| S23 a publish lands while two requests wait on the render: they share one new render, and it is stored | End to end | not run | pass | pass | pass |
| the deck: S1 cold→warm→edge … S15 serve-time stitching | End to end | not run | pass | pass | pass |
packages/postrender/test/deploy.test.ts | |||||
| a deploy is a write for the app’s own stored pages > a page stored by the old build is not served by the new one: it renders, and is stored again | Unit | pass | not run | not run | not run |
| a deploy is a write for the app’s own stored pages > federation asked first: the page path still finds the new build (one answer for both) | Unit | pass | not run | not run | not run |
| a deploy is a write for the app’s own stored pages > the page path asked first: federation still hears the previous build | Unit | pass | not run | not run | not run |
| a deploy is a write for the app’s own stored pages > the same build booting again keeps its pages | Unit | pass | not run | not run | not run |
| a stored page is served only to the build that stored it > a page stored before builds were recorded is not served | Unit | pass | not run | not run | not run |
| a stored page is served only to the build that stored it > an old instance still running stores a page after the new build’s check: the new build does not serve it | Unit | pass | not run | not run | not run |
packages/postrender/test/dev-note.test.ts | |||||
| the dev note says what production does > a page the app marked no-store: not would-store (production refuses it) | Unit | pass | not run | not run | not run |
| the dev note says what production does > a permanent redirect: would store (production stores it) | Unit | pass | not run | not run | not run |
| the dev note says what production does > a plain page: would store | Unit | pass | not run | not run | not run |
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 one of its three 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/messages-node.test.ts | |||||
| the message tables > load under plain Node, which has no import.meta.env | Unit | pass | not run | not run | not run |
packages/postrender/test/plugin.test.ts | |||||
| a page rendered for one visitor is never served to another > a request with a cookie or authorization is not stored, even when the render read nothing | Unit | pass | not run | not run | not run |
| a page rendered for one visitor is never served to another > a route that sets `config.postrender = 'with-credentials'` is stored from such a request | Unit | pass | not run | not run | not run |
| a page rendered for one visitor is never served to another > the opt-in never stores a render that read the visitor | Unit | pass | not run | not run | not run |
| a page rendered for one visitor is never served to another > two visitors: Alice’s signed-in page never reaches Bob | Unit | pass | not run | not run | not run |
| 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 > listed without dataShake() it fails the build, naming the line to add; beside it, seeds are shaped | 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 capture that fails after reading the page sends the page as rendered, and says why it was not stored | 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 > a stored page whose stitch throws sends the page it read, and says why | 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 |
| postrender/stitch — region tags the browser does not read > a region tag in a comment or raw text in a fallback does not move the balance (#975)#975 | Unit | pass | not run | not run | not run |
| postrender/stitch — region tags the browser does not read > finds the holes the browser builds, whatever comments and raw text the page carries | 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 > clamps a TTL under 60 seconds up to KV’s 60-second floor, for the page and its tag keys | 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) > escapes glob characters of a prefix in the SCAN pattern | 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 in the read set (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 > every way a render reaches the visitor is a per-visitor read > `has` on a personal header | Unit | pass | not run | not run | not run |
| postrender/observe > every way a render reaches the visitor is a per-visitor read > `in` on locals | Unit | pass | not run | not run | not run |
| postrender/observe > every way a render reaches the visitor is a per-visitor read > a clone of the request | Unit | pass | not run | not run | not run |
| postrender/observe > every way a render reaches the visitor is a per-visitor read > a copy of the request headers | Unit | pass | not run | not run | not run |
| postrender/observe > every way a render reaches the visitor is a per-visitor read > a fetch to its own origin that carries the visitor’s cookies | Unit | pass | not run | not run | not run |
| postrender/observe > every way a render reaches the visitor is a per-visitor read > a function-valued locals entry (a session getter) | Unit | pass | not run | not run | not run |
| postrender/observe > every way a render reaches the visitor is a per-visitor read > a geo header | Unit | pass | not run | not run | not run |
| postrender/observe > every way a render reaches the visitor is a per-visitor read > per-request platform data | Unit | pass | not run | not run | not run |
| postrender/observe > every way a render reaches the visitor is a per-visitor read > reads that are the same for every visitor still store | Unit | pass | not run | not run | not run |
| postrender/observe > every way a render reaches the visitor is a per-visitor read > the client address | Unit | pass | not run | not run | not run |
| postrender/observe > every way a render reaches the visitor is a per-visitor read > the client address header | Unit | pass | not run | not run | not run |
| postrender/observe > every way a render reaches the visitor is a per-visitor read > the forwarded host | Unit | pass | not run | not run | not run |
| postrender/observe > every way a render reaches the visitor is a per-visitor read > the keys of locals | Unit | pass | not run | not run | not run |
| postrender/observe > every way a render reaches the visitor is a per-visitor read > the request headers as entries | 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's read set; 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 > reads region tags as a browser does: a quoted `>`, any case, single quotes, not in a comment, not a value | 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 client families and glob paths > evicts a prefix that holds a glob character literally, never a sibling it would match as a glob | Unit | pass | not run | not run | not run |
| valkey client families and glob paths > speaks ioredis: SET … EX positionally, never the options bag | Unit | pass | not run | not run | not run |
| valkey client families and glob paths > speaks node-redis v4: SET with an options bag after the positional form throws, and an object SCAN reply | Unit | pass | 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/property-conditional.test.ts | |||||
| If-None-Match on a stored page > a weakened etag, `*`, and the etag in a list all answer 304 | Unit | pass | not run | not run | not run |
| If-None-Match on a stored page > any list of entity tags: 304 exactly when RFC 9110 says the page matches | Unit | pass | not run | not run | not run |
packages/postrender/test/refusals-and-ages.test.ts | |||||
| a refused page is stamped no-store when the app set nothing > a 200 HTML page that sets a cookie is refused and stamped, and never stored | Unit | pass | not run | not run | not run |
| a refused page is stamped no-store when the app set nothing > a 404 page is refused but not stamped | Unit | pass | not run | not run | not run |
| a refused page is stamped no-store when the app set nothing > a page rendered for a visitor with credentials is stamped | Unit | pass | not run | not run | not run |
| a refused page is stamped no-store when the app set nothing > a page the app marked `no-store` is refused | Unit | pass | not run | not run | not run |
| a refused page is stamped no-store when the app set nothing > a page the app marked `private` is refused, and keeps the app’s header | Unit | pass | not run | not run | not run |
| a refused page is stamped no-store when the app set nothing > a render invalidated while it ran is stamped, and not stored | Unit | pass | not run | not run | not run |
| a refused page is stamped no-store when the app set nothing > a stored page is not stamped | Unit | pass | not run | not run | not run |
| a request that joined a render > an invalidation ends the render it joined: it renders the page anew, and that render is stored | Unit | pass | not run | not run | not run |
| If-Modified-Since > an If-None-Match that does not match wins over a later If-Modified-Since | Unit | pass | not run | not run | not run |
| If-Modified-Since > equal to Last-Modified is a 304; a second earlier is the page | Unit | pass | not run | not run | not run |
| the ttl backstop > a page 1 ms under ttl old is served; exactly ttl old is a miss | Unit | pass | not run | not run | not run |
packages/postrender/test/remote-call.test.ts | |||||
| a remote call made from a stored page > is never stored as the page on a miss | Unit | pass | not run | not run | not run |
| a remote call made from a stored page > is not answered with the stored page: the call runs | 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-adapters-paged.test.ts | |||||
| a tag set expiry is set only when it grows > upstash: a put with the same ttl as the set has left sets no expiry | Unit | pass | not run | not run | not run |
| a tag set expiry is set only when it grows > valkey: a put with the same ttl as the set has left sets no expiry | Unit | pass | not run | not run | not run |
| cloudflare kv store, one key per listing page > evict removes the key | Unit | pass | not run | not run | not run |
| cloudflare kv store, one key per listing page > evictByTag empties the tag index: a second eviction finds nothing | Unit | pass | not run | not run | not run |
| cloudflare kv store, one key per listing page > evictWhere follows the cursor past the first page, and takes the prefix key itself | Unit | pass | not run | not run | not run |
| upstash store, one key per listing page > evict removes the key | Unit | pass | not run | not run | not run |
| upstash store, one key per listing page > evictByTag empties the tag index: a second eviction finds nothing | Unit | pass | not run | not run | not run |
| upstash store, one key per listing page > evictWhere follows the cursor past the first page, and takes the prefix key itself | Unit | pass | not run | not run | not run |
| upstash: a trailing slash on the url is dropped, and the token is the bearer | Unit | pass | not run | not run | not run |
| valkey store, one key per listing page > evict removes the key | Unit | pass | not run | not run | not run |
| valkey store, one key per listing page > evictByTag empties the tag index: a second eviction finds nothing | Unit | pass | not run | not run | not run |
| valkey store, one key per listing page > evictWhere follows the cursor past the first page, and takes the prefix key itself | 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 |