LuxelEspañol

Luxel v0.1 · Guide · part 2 of 2

Testing screens (preview) (2)

The command

luxel test [files…] [--mutate-bindings [--jobs ‹n>] [--mutant-timeout ‹ms>]] [--json] [--root ‹dir>]

Without files it runs tests/**/*.test.mjs (also .js, .ts, .mts) of the app with node --test. A test file can also be run directly with node --test tests/contacts.test.mjs from the app's directory; the harness then checks the build itself. Outside node:test, call close() (exported by @luxel-framework/cli/test) when you are done, so the host stops.

What it does not cover yet

  • A test names a screen by its id, a string. A screen file is TSX, and Node does not run TSX, so a test cannot import the screen itself. views.‹id> from the generated .luxel/server.ts is typed.
  • Rows with inputs (an event that sends a collection's rows), the options of a Select, charts and number zones, links, pages with several contexts, and Luxel Visual pages.
  • Nothing a browser computes: layout, focus, what is visible, CSS. Use Playwright for those.
  • The build check compares modification times. It catches a forgotten build, not a build made from other sources.
  • The host prints its start line ("msg":"luxel.start") once per test file.
  • A collection is named by the compiled view's label, because the served page does not carry it.
  • The gateway's own refusals (rate limit, origin, token) are Spanish literals in the status zone, whatever the app's language (GAPS.md). A test that reads such a message reads that text.

What has been measured, and what has not

Measured on the repository's fixture app (two screens, in-memory stores, the suite of 9 tests):

  • the suite passes without a browser, and --mutate-bindings detects 12 of 12 bound zones; a suite that never reads one zone is reported with exactly that zone;
  • time for luxel test after luxel build, 10 runs each, on a shared development machine (an indication, not the criterion's measurement): node:test's own duration, median 926 ms in the first measurement and median 1174 ms in a second one taken while the machine was under heavy load (load average 36). Not measured on the official measurement machine.

Not measured yet (the D4 criterion is decided on the demo app, which is rewritten later in the sprint):

  • the demo app's behaviours (search, page, validation, create) as screen tests: NOT RUN;
  • mutation of the demo's views: NOT RUN;
  • parity with the E2E on the same cases: the Playwright spec of the fixture's cases is written (tests/e2e/screen-parity.spec.mjs); it was NOT RUN by its author;
  • the ≤ 1 s time on the demo: NOT MEASURED;
  • a run with PostgreSQL stores: NOT RUN.
Edit this page on GitHub

This page: 7.9 KB of JavaScript (Luxel's shared runtime), 0 KB from your app.

Measured when the site is built: the runtime files this page loads, compressed as they are sent.

Made by IntiOps. Luxel 0.1.0-beta.1 is a beta: no external security review yet.