Tests / @ogygia/postrender

@ogygia/postrender

Version 0.14.0 latest
commit 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

TestKindNodeChromiumFirefoxWebKit
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 endnot runpasspasspass
an ELIGIBLE page renders EVERY time in dev (no store), flagged would-storeEnd to endnot runpasspasspass
the right handle order says nothingEnd to endnot runpasspasspass
packages/postrender/e2e/postrender-order.spec.ts
dev, postrender.handle() AFTER ogygia.handle(): a page request is a clear errorEnd to endnot runpasspasspass
production, no postrender.handle() at all: one warning, the memory store servesEnd to endnot runpasspasspass
production, postrender.handle() AFTER ogygia.handle(): one warning, pages still storedEnd to endnot runpasspasspass
packages/postrender/e2e/postrender.spec.ts
S20 a later plugin answers the flight’s request: the next cold request is not left waitingEnd to endnot runpasspasspass
S21 a publish lands while the page renders: the render is served, not storedEnd to endnot runpasspasspass
S22 a form post on another page while the page renders: the render is still storedEnd to endnot runpasspasspass
S23 a publish lands while two requests wait on the render: they share one new render, and it is storedEnd to endnot runpasspasspass
the deck: S1 cold→warm→edge … S15 serve-time stitchingEnd to endnot runpasspasspass
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 againUnitpassnot runnot runnot 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)Unitpassnot runnot runnot run
a deploy is a write for the app’s own stored pages > the page path asked first: federation still hears the previous buildUnitpassnot runnot runnot run
a deploy is a write for the app’s own stored pages > the same build booting again keeps its pagesUnitpassnot runnot runnot run
a stored page is served only to the build that stored it > a page stored before builds were recorded is not servedUnitpassnot runnot runnot 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 itUnitpassnot runnot runnot 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)Unitpassnot runnot runnot run
the dev note says what production does > a permanent redirect: would store (production stores it)Unitpassnot runnot runnot run
the dev note says what production does > a plain page: would storeUnitpassnot runnot runnot run
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 one of its three 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/messages-node.test.ts
the message tables > load under plain Node, which has no import.meta.envUnitpassnot runnot runnot 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 nothingUnitpassnot runnot runnot 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 requestUnitpassnot runnot runnot run
a page rendered for one visitor is never served to another > the opt-in never stores a render that read the visitorUnitpassnot runnot runnot run
a page rendered for one visitor is never served to another > two visitors: Alice’s signed-in page never reaches BobUnitpassnot runnot runnot run
postrender() — the vite value > its build hook claims the `postrender` key inside Kit’s `config`Unitpassnot runnot runnot run
postrender() — the vite value > listed without dataShake() it fails the build, naming the line to add; beside it, seeds are shapedUnitpassnot runnot runnot run
postrender() — the vite value > names the package and normalizes its optionsUnitpassnot runnot runnot run
the server realm, started > a capture that fails after reading the page sends the page as rendered, and says why it was not storedUnitpassnot 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 > a stored page whose stitch throws sends the page it read, and says whyUnitpassnot 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
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)#975Unitpassnot runnot runnot run
postrender/stitch — region tags the browser does not read > finds the holes the browser builds, whatever comments and raw text the page carriesUnitpassnot 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 > clamps a TTL under 60 seconds up to KV’s 60-second floor, for the page and its tag keysUnitpassnot 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) > escapes glob characters of a prefix in the SCAN patternUnitpassnot 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 in the read set (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 > every way a render reaches the visitor is a per-visitor read > `has` on a personal headerUnitpassnot runnot runnot run
postrender/observe > every way a render reaches the visitor is a per-visitor read > `in` on localsUnitpassnot runnot runnot run
postrender/observe > every way a render reaches the visitor is a per-visitor read > a clone of the requestUnitpassnot runnot runnot run
postrender/observe > every way a render reaches the visitor is a per-visitor read > a copy of the request headersUnitpassnot runnot runnot 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 cookiesUnitpassnot runnot runnot run
postrender/observe > every way a render reaches the visitor is a per-visitor read > a function-valued locals entry (a session getter)Unitpassnot runnot runnot run
postrender/observe > every way a render reaches the visitor is a per-visitor read > a geo headerUnitpassnot runnot runnot run
postrender/observe > every way a render reaches the visitor is a per-visitor read > per-request platform dataUnitpassnot runnot runnot run
postrender/observe > every way a render reaches the visitor is a per-visitor read > reads that are the same for every visitor still storeUnitpassnot runnot runnot run
postrender/observe > every way a render reaches the visitor is a per-visitor read > the client addressUnitpassnot runnot runnot run
postrender/observe > every way a render reaches the visitor is a per-visitor read > the client address headerUnitpassnot runnot runnot run
postrender/observe > every way a render reaches the visitor is a per-visitor read > the forwarded hostUnitpassnot runnot runnot run
postrender/observe > every way a render reaches the visitor is a per-visitor read > the keys of localsUnitpassnot runnot runnot run
postrender/observe > every way a render reaches the visitor is a per-visitor read > the request headers as entriesUnitpassnot runnot runnot run
postrender/observe > personalization headers disqualify; delivery plumbing does notUnitpassnot runnot runnot run
postrender/observe > the reason lands in the request's read set; 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 > reads region tags as a browser does: a quoted `>`, any case, single quotes, not in a comment, not a valueUnitpassnot 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 client families and glob paths > evicts a prefix that holds a glob character literally, never a sibling it would match as a globUnitpassnot runnot runnot run
valkey client families and glob paths > speaks ioredis: SET … EX positionally, never the options bagUnitpassnot runnot runnot 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 replyUnitpassnot 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/property-conditional.test.ts
If-None-Match on a stored page > a weakened etag, `*`, and the etag in a list all answer 304Unitpassnot runnot runnot run
If-None-Match on a stored page > any list of entity tags: 304 exactly when RFC 9110 says the page matchesUnitpassnot runnot runnot 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 storedUnitpassnot runnot runnot run
a refused page is stamped no-store when the app set nothing > a 404 page is refused but not stampedUnitpassnot runnot runnot run
a refused page is stamped no-store when the app set nothing > a page rendered for a visitor with credentials is stampedUnitpassnot runnot runnot run
a refused page is stamped no-store when the app set nothing > a page the app marked `no-store` is refusedUnitpassnot runnot runnot 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 headerUnitpassnot runnot runnot run
a refused page is stamped no-store when the app set nothing > a render invalidated while it ran is stamped, and not storedUnitpassnot runnot runnot run
a refused page is stamped no-store when the app set nothing > a stored page is not stampedUnitpassnot runnot runnot run
a request that joined a render > an invalidation ends the render it joined: it renders the page anew, and that render is storedUnitpassnot runnot runnot run
If-Modified-Since > an If-None-Match that does not match wins over a later If-Modified-SinceUnitpassnot runnot runnot run
If-Modified-Since > equal to Last-Modified is a 304; a second earlier is the pageUnitpassnot runnot runnot run
the ttl backstop > a page 1 ms under ttl old is served; exactly ttl old is a missUnitpassnot runnot runnot run
packages/postrender/test/remote-call.test.ts
a remote call made from a stored page > is never stored as the page on a missUnitpassnot runnot runnot run
a remote call made from a stored page > is not answered with the stored page: the call runsUnitpassnot 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-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 expiryUnitpassnot runnot runnot 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 expiryUnitpassnot runnot runnot run
cloudflare kv store, one key per listing page > evict removes the keyUnitpassnot runnot runnot run
cloudflare kv store, one key per listing page > evictByTag empties the tag index: a second eviction finds nothingUnitpassnot runnot runnot run
cloudflare kv store, one key per listing page > evictWhere follows the cursor past the first page, and takes the prefix key itselfUnitpassnot runnot runnot run
upstash store, one key per listing page > evict removes the keyUnitpassnot runnot runnot run
upstash store, one key per listing page > evictByTag empties the tag index: a second eviction finds nothingUnitpassnot runnot runnot run
upstash store, one key per listing page > evictWhere follows the cursor past the first page, and takes the prefix key itselfUnitpassnot runnot runnot run
upstash: a trailing slash on the url is dropped, and the token is the bearerUnitpassnot runnot runnot run
valkey store, one key per listing page > evict removes the keyUnitpassnot runnot runnot run
valkey store, one key per listing page > evictByTag empties the tag index: a second eviction finds nothingUnitpassnot runnot runnot run
valkey store, one key per listing page > evictWhere follows the cursor past the first page, and takes the prefix key itselfUnitpassnot 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