test (js, cli)
test is a unit-test harness written in pure Edge Python, not a compiled plugin. Declare it with edge add test and import it by bare name. To pin a different version, point the edge.json entry at another URL, see Modules.
@fixture registers a factory under its function’s name. @test(description, *uses) registers a test and the fixtures to inject by keyword. raises(ExcType) is a context manager asserting the block raises, and it accepts a class or a tuple of classes. run() executes every registered test, prints a PASS -, FAIL -, or ERROR line per test plus a summary, and raises SystemExit(1) if anything failed, else SystemExit(0). Fixtures are flat and built fresh per test, with no scopes, autouse, or parametrization. One module-level registry holds every test, so run() executes all of them.
PASS - user has a name PASS - division by zero raises 2 passed, 0 failed
Fixtures are built fresh per test, so one test cannot leak state into another:
PASS - first sees an empty list PASS - second also sees an empty list 2 passed, 0 failed
A failed assertion prints a FAIL - line with the error, and run() exits nonzero:
PASS - two plus two FAIL - this one fails (AssertionError: letter missing) 1 passed, 1 failed
edge test discovers *_test.py files and drives run() for you, reading the verdict from the exit code.