pagez

tests

Pagez's tests, apart from its sources.

  • elements/ holds the elements' unit tests, one file for each source in src/elements/.
  • pages/ holds the pages Pagez must build, or must fail on, written ahead of the compiler.
  • pages.test.ts builds each of them, and compares it with its snapshot in snapshots/.
  • sites/ holds folders of many pages, and sites.test.ts builds every page of each, to its snapshot in snapshots/sites/.
  • speed/ holds the scripts that time a large build and hold a page's size to a budget.

Folders

  • elements/

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

  • pages/

    The pages Pagez must build, one folder each, written before the compiler to pin down what it does. Each folder holds an index.md and whatever sits beside it, such as @x-tag.html files, an frame.html, a style.css, scripts, images or a node_modules.

  • sites/

    The sites Pagez must build, or must fail on, one folder each, as the test pages are for one page. Each is a folder of pages, with what pages says about many pages: a page at its folder's path, the nearest style.css and frame.html, pagez.md at the root, links between pages, and what a site adds, from pages to redirects.

  • speed/

    How fast Pagez builds, and how much it adds to a page. These are scripts, not tests, and development says how to run them.

Code

  • args.test.ts

    What pagez makes of what it's given: a command, a folder and a port, or one line saying what's wrong, with the usage.

  • check.test.ts

    check lists every page's failure and every warning, a line each, with its id, and writes nothing. printedRule prints a rule, an error or a warning from the docs the package ships.

  • css.test.ts

    The rules the theme keeps, which a change to it could break without any page looking wrong at first. It's one layer, so any other CSS beats it, and it styles only what Markdown writes, with no classes. How it looks is checked by eye, on the prose and stories test pages.

  • docs.test.ts

    Pages and elements state each rule once, as a list item that opens with its id, and end it with the cases that hold it. This holds the docs and the tests to each other, so a rule can't be stated without a test, and a case can't test what no rule states.

  • head.test.ts

    What fails a frame, each with the line to add or remove, and the metadata the head reads. Then what Pagez writes in a page's head, which is the page's lang, title and description in place of the frame's, and the tags that follow.

  • pages.test.ts

    Each page in tests/pages/ builds to its snapshot in tests/snapshots/<page>/page.html, or an error-… page fails with error.txt, its file named from tests/pages/.

  • sites.test.ts

    Each site in tests/sites/ builds every page, its 404.html and its _redirects to their snapshots in tests/snapshots/sites/<site>/, at the path each is built at. An error-… site fails with error.txt instead, its file named from tests/sites/. Pagez's theme stands as a comment, as in pages.test.ts.

  • vite.test.ts

    The plugin builds a folder's pages through Vite, each to its folder in dist/, with their references hashed into dist/assets/, each page's elements' behavior bundled into one module, and leaves the folder as it was. A folder that has an index.html where a page is built fails, since that's the file Pagez writes.

No prose yet

snapshots/