Skip to main content

Module testing

Module testing 

Source
Expand description

htl test: discovery, one isolated Lua state per test file, compile, report.

The runner owns nothing about assertions. A test file requires a library; the bundled default is htl.test (describe / it / expect, typed via test.d.tl). Any library exposing run(filter) -> { passed, failed, failures } under the module name the runner is told about plugs in the same way. A file that uses no such library is judged at file level: it passes if it runs to completion.

Structs§

FileReport
Outcome of one test file.

Constants§

DEFAULT_LIB
Module name of the bundled assertion library.

Functions§

discover_tests
*_test.tl anywhere, plus every .tl under a directory named tests. Explicit file paths are always included. Skips target/, .git/, node_modules/.
lib_dir
Directory holding the bundled .d.tl files so the checker can see them (<tmp>/htl-lib-<version>/). Written on demand, only when content changes.
run_test_file
Run one test file in a fresh state. lib is the assertion library module to consult for run(filter) after the file executed (default: htl.test).