Vectrune documentationAlpha referenceLearning site ↗

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.

Example
@Test/Health
run:
    req = { path: "/health" }
    res = test-request req
    assert res.status == 200

Implementation: 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

@TestSuite

Declare 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.

Example
assert res.status == 200

Implementation: 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.

Example
invoke add 1

Implementation: src/cli/logic_testing.rs

mock

mock.storage | mock.downloads | mock.clipboard | mock.audio

Inspect recorded host effects in a frontend logic test.

Runtime: Test harness

Returns / effects

Mock snapshots; host operations are recorded without a browser or network.

Example
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.

Example
req = { method: "GET", path: "/health" }
res = test-request req

Implementation: src/cli/testing.rs