Skip to main content

Module proxy

Module proxy 

Source
Available on non-WebAssembly only.
Expand description

The native proxy that runs each test in a browser instead of in-process.

When WASM_TEST_ENV is set, the test binary stops being a runner and becomes a client: cargo nextest still lists and drives it, but each trial makes an HTTP request to the local runner, which opens the page and runs that one test in a real browser. The verdict comes back as the response’s status, so nextest reports a browser failure exactly as it reports an in-process one — same listing, same filters, same exit code.

The mode is chosen from the environment rather than by a cfg.

This is why the trial names carry a [wasm] marker: the wasm nextest profile selects them with default-filter = "test([wasm])", so a single cargo nextest run drives only the browser side and never the in-process one.

Re-exports§

use crate::TestEntry; 🔒

Constants§

PORT 🔒
The port the browser runner listens on.
WASM_MARKER 🔒
The marker every trial name carries, and what the wasm nextest profile filters on.
WASM_TEST_ENV
The environment variable that puts a test binary in proxy mode.

Functions§

run_in_browser 🔒
Ask the runner to run one test in a browser, and report what it said.
run_wasm
Run every registered test in the browser, reporting through libtest-mimic.