Allure Report integration for the rstest test runner.
Not battle tested. Almost fully vibe-coded, but design is inspired by allure-vitest and DX improved according to hands on experience of allure-jest and allure-vitest.
Both lines are required. rstest does not let a reporter append setupFiles for you,
so the setup file is wired up manually.
Four channels work at the same time and are merged as described below.
rstest inherits meta from describe down to nested tests, and child keys override
inherited ones — the runner does this for you. Use allureMeta() (instead of a raw object)
so the Allure keys are type-checked at compile time.
A synchronous variant is available from allure-rstest/sync; the same names return void.
Title → declarative meta (suite, then test) → runtime API.
epic, feature, story, component, layer, tag,
arbitrary ones) accumulate across all channels.severity, owner, lead, allureId, parentSuite,
suite, subSuite) — the last channel wins.Technical labels (host, thread, package, framework, language) are set by the
reporter and are not overridden by user channels.
component is not part of Allure's built-in label set and does not feed the Behaviors
tab — it is a plain label used for grouping and filtering.
| Field | Type | Purpose |
|---|---|---|
resultsDir |
string |
Where to write results. Defaults to ./allure-results |
links |
LinkConfig |
URL templates per link type |
globalLabels |
Label[] | Record<string, string | string[]> |
Labels added to every test |
categories |
Category[] |
Defect category definitions |
environmentInfo |
Record<string, string | undefined> |
Environment information |
listeners |
LifecycleListener[] |
Result lifecycle hooks |
reportMatchers |
boolean |
Turn expect calls into steps. Defaults to true |
cleanResults |
boolean |
Remove stale Allure artifacts from resultsDir at run start. Defaults to true |
enabled |
boolean |
Run the integration as a no-op when false. Defaults to the ALLURE_ENABLED env var, or true |
To run rstest with zero Allure side effects (for example, in fast local development while keeping the report only on CI), either set the env var for the whole run:
or pass enabled: false to the reporter:
When disabled, the setup file skips wrapping test/it, matchers and the runtime, and
the reporter writes nothing. The deprecated globalThis.allure object stays defined as a
no-op, so existing code using it keeps working.
browser.commands nor
provide/inject, so there is no way to read the testplan file from the browser.AsyncLocalStorage, so the running test cannot be resolved and Allure API calls inside
a browser test are no-ops. Browser mode runs the tests and produces results, but steps,
attachments and labels are not reported per test.globalThis["@rstest/core"]) and
is verified against @rstest/core@0.11.12. On a minor version mismatch the package
prints a warning.Welcome.
MIT