Testing
Native request tests and headless frontend logic testing.
@Test¶
@Test/<name>Declare a test with run steps. Native tests use an in-process router; frontend tests use the logic harness.
Runtime: Test harness
Returns / effects
A result in the CLI test report.
@Test/Health
run:
req = { path: "/health" }
res = test-request req
assert res.status == 200Implementation: src/cli/testing.rs
@TestFixture¶
@TestFixture/<name>Declare reusable fixture setup and teardown.
Runtime: Test harness
Returns / effects
Activated by a test fixtures list.
Implementation: src/cli/testing.rs
@TestSuite¶
@TestSuiteDeclare suite-level setup and teardown steps.
Runtime: Test harness
Returns / effects
Test lifecycle configuration.
Implementation: src/cli/testing.rs
assert¶
assert <condition>Assert a condition in a native or frontend logic test.
Runtime: Test harness
Returns / effects
Records an assertion or fails the test.
assert res.status == 200Implementation: src/cli/testing.rs
invoke¶
invoke <action> [JSON value or JSON argument array]Invoke a frontend action in the headless logic harness.
Runtime: Test harness
Returns / effects
Action effects in test state.
invoke add 1Implementation: src/cli/logic_testing.rs
mock¶
mock.storage | mock.downloads | mock.clipboard | mock.audioInspect recorded host effects in a frontend logic test.
Runtime: Test harness
Returns / effects
Mock snapshots; host operations are recorded without a browser or network.
assert mock.downloads[0].filename == "save.json"Implementation: runtime/rune-web/src/testing/host.ts
test-request¶
response = test-request <requestVariable>Send a request through the in-process native application router.
Runtime: Test harness
Returns / effects
Response object exposing status, text and parsed body for test assertions.
req = { method: "GET", path: "/health" }
res = test-request reqImplementation: src/cli/testing.rs