Tests / @ogygia/bake

@ogygia/bake

Version 0.14.0 latest
commit 620ddcca
33 test runs (33 tests, each run in Node, the browsers or both)
0.86× lines of test for each line of source (435 to 505) 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.4% of source lines run by the tests
  • 33Unit
  • 0Browser
  • 0End to end
  • 0Type tests
  • 0Lint rules
  • 0Failing

Coverage

  • 88.4%Lines
  • 69.6%Branches
  • 86.8%Functions
  • 87.1%Statements

Every test

33 tests

TestKindNodeChromiumFirefoxWebKit
packages/bake/test/bake.test.ts
rewrite_bake — dev: an edited input bakes fresh > an edited data module bakes its new value, with the same entry textUnitpassnot runnot runnot run
rewrite_bake — dev: an edited input bakes fresh > many bakes of one module at once all land, none breaks anotherUnitpassnot runnot runnot run
rewrite_bake — dev: an edited input bakes fresh > names every module the bake bundled as a file to watchUnitpassnot runnot runnot run
rewrite_bake — real build-time evaluation > a non-serializable result is a build error naming the fixUnitpassnot runnot runnot run
rewrite_bake — real build-time evaluation > awaits an async bake fnUnitpassnot runnot runnot run
rewrite_bake — real build-time evaluation > drops an import that only fed a baked fn (ship the answer, not the computation)Unitpassnot runnot runnot run
rewrite_bake — real build-time evaluation > executes an imported fn at build and inlines its devalue-serialized result (Date survives)Unitpassnot runnot runnot run
rewrite_bake — real build-time evaluation > KEEPS an import still used outside the baked fnUnitpassnot runnot runnot run
rewrite_bake — validation (no execution) > ignores the marker inside a comment or stringUnitpassnot runnot runnot run
rewrite_bake — validation (no execution) > rejects a non-function argumentUnitpassnot runnot runnot run
rewrite_bake — validation (no execution) > rejects wrong arityUnitpassnot runnot runnot run
rewrite_bake — validation (no execution) > returns the same reference when there is no bake callUnitpassnot runnot runnot run
packages/bake/test/plugin.test.ts
bake() beside ogygia() > bakes the call through the app alias, and the import that fed it leaves the bundleUnitpassnot runnot runnot run
bake() beside ogygia() > the module a bake bundled is a watch file of the build, so an edit to it re-bakesUnitpassnot runnot runnot run
bake() beside ogygia() > without bake() the build fails with macro_needs_plugin, and nothing runsUnitpassnot runnot runnot run
packages/bake/test/stress.test.ts
bake — byte-offset integrity under multi-byte unicode > TWO bake() calls interleaved with unicode both inline at the right spotsUnitpassnot runnot runnot run
bake — devalue serialization torture (real execution) > a CIRCULAR structure serializes (devalue references)Unitpassnot runnot runnot run
bake — devalue serialization torture (real execution) > a fn that THROWS at build surfaces as a build errorUnitpassnot runnot runnot run
bake — devalue serialization torture (real execution) > a frozen object and a 10k-element array both inlineUnitpassnot runnot runnot run
bake — devalue serialization torture (real execution) > a function in the result FAILS LOUDLYUnitpassnot runnot runnot run
bake — devalue serialization torture (real execution) > a Symbol in the result FAILS LOUDLYUnitpassnot runnot runnot run
bake — devalue serialization torture (real execution) > an async fn using await Promise.all([...]) resolvesUnitpassnot runnot runnot run
bake — devalue serialization torture (real execution) > Date, Map, Set, RegExp round-tripUnitpassnot runnot runnot run
bake — devalue serialization torture (real execution) > exotic primitives: undefined, NaN, Infinity, -0, BigIntUnitpassnot runnot runnot run
bake — devalue serialization torture (real execution) > nested + sparse arrays and unicode stringsUnitpassnot runnot runnot run
bake — devalue serialization torture (real execution) > nested Map-of-Sets and a getter (evaluated) serializeUnitpassnot runnot runnot run
bake — devalue serialization torture (real execution) > referencing an undeclared/non-imported name FAILS LOUDLYUnitpassnot runnot runnot run
bake — devalue serialization torture (real execution) > typed array (Uint8Array) and ArrayBuffer serializeUnitpassnot runnot runnot run
bake — resolution depth (real execution, real files) > a fn importing a sibling that imports another sibling (transitive)Unitpassnot runnot runnot run
bake — resolution depth (real execution, real files) > a fn importing and using a node: builtinUnitpassnot runnot runnot run
bake in .svelte — component import excluded from the eval bundle > the .svelte component import stays out of the Node eval; the bake still resolves its dataUnitpassnot runnot runnot run
misuse-error QUALITY — build-voice, file:line, explains the fix > bake with a non-function arg → must be a function + lineUnitpassnot runnot runnot run
misuse-error QUALITY — build-voice, file:line, explains the fix > bake with wrong arity → takes exactly one argumentUnitpassnot runnot runnot run