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:
TypeScriptimport 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
.
links
Patterns that can be used to construct full URLs from short identifiers, see the 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.