pagez

Element tests

The elements' unit tests, one file for each source in src/elements/.

Code

  • elements.test.ts

    What an element does in a frame and in another element's output, which is what it does in text.

  • file.test.ts

    An element file read into its parts, each part as a module on the file's own lines, and every check that needs only the file, each failing with the line.

  • markup.test.ts

    Where the tags are, with their attributes, and what isn't a tag: a comment, text in a script, a < in a value. Offsets let a caller replace a value without rewriting the rest.

  • render.test.ts

    One row for each place a value can go, with what the build writes there, then the templates the build refuses. A rule in elements.md's html section has its case here. The tables are left unformatted, since oxfmt would reflow the HTML inside them, and each row is exact.

  • runtime.test.ts

    define in happy-dom: setup runs once per connection with a fresh signal, and a disconnect aborts it and calls the cleanup setup returned. The source the host writes into its script (String(define)) defines elements too.