Tests / @ogygia/flags
@ogygia/flags
Version 0.13.1
4b18f465 44 test runs (44 tests, each run in Node, the browsers or both)
0.79× lines of test for each line of source (655 to 825) 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)88.0% of source lines run by the tests
- 44Unit
- 0Browser
- 0End to end
- 0Type tests
- 0Lint rules
- 0Failing
Coverage
- 88.0%Lines
- 74.7%Branches
- 86.4%Functions
- 87.4%Statements
Every test
End-to-end suites are not part of this report yet.
44 tests
| Test | Kind | Node | Chromium | Firefox | WebKit |
|---|---|---|---|---|---|
packages/flags/test/exposure-queue.test.ts | |||||
| the exposure queue > a batch the sink failed is tried again before the batch read after it | Unit | pass | not run | not run | not run |
| the exposure queue > a sink that rejects is contained: no unhandled rejection, and a warning with its code | Unit | pass | not run | not run | not run |
| the exposure queue > an exposure read while a send is in flight goes in the next send, and that end waits for it | Unit | pass | not run | not run | not run |
| the exposure queue > nothing buffered: the end has nothing to wait for | Unit | pass | not run | not run | not run |
| the exposure queue > the age cap sends a buffered batch on its own | Unit | pass | not run | not run | not run |
| the exposure queue > the request's end resolves after the sink's send | Unit | pass | not run | not run | not run |
packages/flags/test/flags.test.ts | |||||
| decide — exposure batching > fires once per (request, flag); flushes at max, at the timer, and at flush_exposures() | Unit | pass | not run | not run | not run |
| decide + source — the OpenFeature seam (any resolver) > a source variant NOT in the declared set is ignored (falls through to native) | Unit | pass | not run | not run | not run |
| decide + source — the OpenFeature seam (any resolver) > a throwing source degrades every flag to native, never the request | Unit | pass | not run | not run | not run |
| decide + source — the OpenFeature seam (any resolver) > bare boolean/string source values are sugar for { variant } | Unit | pass | not run | not run | not run |
| decide + source — the OpenFeature seam (any resolver) > override still beats the source | Unit | pass | not run | not run | not run |
| decide + source — the OpenFeature seam (any resolver) > source decides a variant; validated against declared variants; primes once per request | Unit | pass | not run | not run | not run |
| decide + source — the source sees the visitor a read hashes on > anonymous → no visitor | Unit | pass | not run | not run | not run |
| decide + source — the source sees the visitor a read hashes on > carried claims win over the cookie; a router visitor wins over both | Unit | pass | not run | not run | not run |
| decide + source — the source sees the visitor a read hashes on > openfeature()'s default context gets the visitor as its targetingKey | Unit | pass | not run | not run | not run |
| decide + source — the source sees the visitor a read hashes on > the og-vid cookie (no router identity above the router) → `{ sub, anonymous }` | Unit | pass | not run | not run | not run |
| federation — decided flags auto-carry > a flag never read this request does NOT carry | Unit | pass | not run | not run | not run |
| federation — decided flags auto-carry > every flag decided this request self-registers its bucket for signed claims | Unit | pass | not run | not run | not run |
| flag — decision precedence > ?og-exp override beats everything (unknown variants ignored) | Unit | pass | not run | not run | not run |
| flag — decision precedence > carried claims (upstream shell) beat the native rule | Unit | pass | not run | not run | not run |
| flag — decision precedence > the override GATE: closed → ?og-exp is inert (prod default); reopened → honored | Unit | pass | not run | not run | not run |
| flag — layers (mutual exclusion, a string group) > a visitor lands in at most ONE member | Unit | pass | not run | not run | not run |
| flag — the four declaration shapes, read by calling > bare = a kill switch, off for everyone | Unit | pass | not run | not run | not run |
| flag — the four declaration shapes, read by calling > function = targeting; true → on, false → definitively off, undefined → fall through | Unit | pass | not run | not run | not run |
| flag — the four declaration shapes, read by calling > number = sticky rollout percent, ~accurate over a population | Unit | pass | not run | not run | not run |
| flag — the four declaration shapes, read by calling > record = weighted variants; anonymous → control (first key) | Unit | pass | not run | not run | not run |
| flag — the four declaration shapes, read by calling > weights are RATIOS, not percentages (3:1 ≈ 75/25) | Unit | pass | not run | not run | not run |
| flag.pick — one verb, two forms > boolean flag pick maps off/on | Unit | pass | not run | not run | not run |
| flag.pick — one verb, two forms > one-arg form = a page slot (ComponentPick), resolved per request, control fallback | Unit | pass | not run | not run | not run |
| flag.pick — one verb, two forms > stamp names the world for analytics | Unit | pass | not run | not run | not run |
| flag.pick — one verb, two forms > two-arg form = pick this visitor a value (numbers, strings, config) | Unit | pass | not run | not run | not run |
| flag.value — vendor payloads, schema-validated > an invalid vendor payload is rejected → fallback (trust boundary) | Unit | pass | not run | not run | not run |
| flag.value — vendor payloads, schema-validated > no source → fallback, never undefined | Unit | pass | not run | not run | not run |
| flag.value — vendor payloads, schema-validated > returns the validated payload, else the fallback | Unit | pass | not run | not run | not run |
packages/flags/test/plugin.test.ts | |||||
| facts a read reports > a read is a per-visitor read (a stored page never keeps one variant) and an assignment | Unit | pass | not run | not run | not run |
| flags() > is named by its package and names its server realm, the module beside it | Unit | pass | not run | not run | not run |
| the server realm > primes the source in `request` and drains exposures in `done` | Unit | pass | not run | not run | not run |
| the server realm primes the source with the visitor > the event's og-vid cookie reaches the source as `c.visitor` | Unit | pass | not run | not run | not run |
packages/flags/test/prime-twice.test.ts | |||||
| a second prime of a request while the first waits > returns once the source answered, and reads get its answer | Unit | pass | not run | not run | not run |
| a source that throws before it awaits anything > leaves the request resolved (empty), never priming for good | Unit | pass | not run | not run | not run |
packages/flags/test/source-failed.test.ts | |||||
| a failing flag source is said > a source that throws: said once for its failing streak, with the error, again after a request worked | Unit | pass | not run | not run | not run |
| a failing flag source is said > an OFREP endpoint that answers 500 | Unit | pass | not run | not run | not run |
| a failing flag source is said > an OFREP endpoint that cannot be reached | Unit | pass | not run | not run | not run |
| a failing flag source is said > an OpenFeature flag whose evaluation throws: said, and the other flags keep the source's answer | Unit | pass | not run | not run | not run |