Allure Vitest configuration

The Allure Vitest adapter behavior can be affected by some configuration options set in your Vitest configuration file, e.g., vitest.config.ts.

The configuration options must be defined in the object passed to the AllureReporter constructor. For example:

TypeScript
import AllureReporter from "allure-vitest/reporter"; import { defineConfig } from "vitest/config"; export default defineConfig({ test: { setupFiles: ["allure-vitest/setup"], reporters: [ "default", new AllureReporter({ resultsDir: "./allure-results", links: [ { type: "issue", urlTemplate: "https://issues.example.com/%s" }, { type: "tms", urlTemplate: "https://tms.example.com/%s" }, ], }), ], }, });

resultsDir

Path to the directory where Allure Vitest will save the test results, see How it works. If the directory does not exist, it will be created. Defaults to allure-results.

Patterns that can be used to construct full URLs from short identifiers, see reference.

Each item of the links list must be an object with the name of a link type and the urlTemplate that will be used to construct URLs for the type. The template must include the %s placeholder. It will be replaced with the original short identifier.

For example, with the configuration above, allure.issue("Related issue", "AUTH-123") will produce a link leading to https://issues.example.com/AUTH-123. Allure will display the link with the appropriate icon for the issue type.

Powered by
logo

Join our newsletter

Join our community

We aim to make Allure Report as reliable and user-friendly as possible, and together with the community, we're here to help when problems arise.

© 2024 Qameta Software Inc. All rights reserved.