vitest-allure

Allure integration for Vitest. Based on code from this thread: allure-framework/allure-js#415

Configuration

Add this reporter to the reporters section of Vitest config

export default defineConfig({
  test: {
    // do not forget to keep the "default" if you want to see something in the console
    reporters: ["default", "TODO-VITEST-ALLURE-PACKAGE"],
    // optional, if you want to write results to a different directory
    outputFile: {
      allure: "allure-results",
    },
  },
});

API

To use advanced test instrumentation features, use allureTest API. Powered by Vitest's test context feature:

import { allureTest } from "TODO-VITEST-ALLURE-PACKAGE/test";

allureTest("labels", ({ allure }) => {
  allure.label("demo", "works");
});

Currently, only labels, steps and attachments are supported.

See the test/features.test.ts for more examples.