banira test

Manifest-driven smoke test: for every custom element found in the sources, banira compiles its module, mounts it in JSDOM, and asserts the tag registers and upgrades.

Usage

$ banira test <files...> [options]

Arguments

ArgumentDescription
<files...>Component source files to test.

Options

OptionDescription
--reflectionAlso round-trip each observed attribute ↔ its backing property and warn on either direction that doesn’t reflect.
--slotsAlso inject sample slotted content and warn on declared @slots with no matching (and shadow s with no @slot).
--sizeAlso report each element’s emitted size (raw + gzip) and a rough first-render time.
--budget <file>Compare size/render time against a baseline JSON and exit 1 on regression (implies --size).
--update-budgetWith --budget: write the current measurement as the baseline instead of comparing.
--threshold <percent>Allowed growth over the baseline. (default: 10)

Examples

smoke-test every element
$ banira test src/*.ts
also check reflection + slots
$ banira test src/*.ts --reflection --slots
gate on a size/render budget
$ banira test src/*.ts --budget budget.json

Notes

Catches the most common breakages — a component that throws on construction, or never calls customElements.define — with no per-component test code. Exits non-zero if any element fails, so it drops straight into CI. --reflection and --slots add advisory warnings (they don’t fail the command), since not every attribute is meant to reflect.

The size is the emitted JavaScript of the element’s module and its local import graph (lowered CSS/HTML included, bare npm imports excluded); the render time is the median construct-and-connect time of a fresh instance in JSDOM — rough, so render regressions under 1 ms are ignored. Create or refresh the baseline with --update-budget.