Allure AVA configuration
The Allure AVA integration behavior can be configured by passing an options object to installAllure() in your AVA configuration file. For example:
// ava.config.mjs
import { installAllure } from "allure-ava";
import { Status } from "allure-js-commons";
import * as os from "node:os";
await installAllure({
resultsDir: "allure-results",
links: {
issue: {
nameTemplate: "Issue #%s",
urlTemplate: "https://issues.example.com/%s",
},
tms: {
nameTemplate: "TMS #%s",
urlTemplate: "https://tms.example.com/%s",
},
jira: {
urlTemplate: "https://jira.example.com/browse/%s",
},
},
categories: [
{
name: "Assertion failures",
matchedStatuses: [Status.FAILED],
},
],
environmentInfo: {
os_platform: os.platform(),
os_release: os.release(),
os_version: os.version(),
node_version: process.version,
},
globalLabels: {
layer: "api",
},
});
export default {};resultsDir
Path to the directory where Allure AVA will save the test results, see How it works. If the directory does not exist, it will be created. Defaults to allure-results.
links
A mapping of templates that can be used to construct full URLs from short identifiers.
For each type of link (see allure.link()), you can specify the following:
nameTemplate— a template for generating the link name when it is not provided.urlTemplate— a template for generating the full link address from a short identifier.
Each template is either a string containing %s at the position where the identifier should be placed, or a function that accepts the identifier and returns the resulting string.
For example, with the configuration above, await allure.issue("123") will produce a link with the name Issue #123 and the address https://issues.example.com/123. Allure will display the link with the appropriate icon for the issue type.
categories
Define custom categories that will be used to distinguish test results by their errors; see Categories.
This setting is an array, each item being an object representing one custom category. The objects may have the following properties:
name— a category name.description— a category description, in plain text.descriptionHtml— a category description, in HTML format.messageRegex— a regular expression that the test result's message should match.traceRegex— a regular expression that the test result's trace should match.matchedStatuses— an array of statuses that the test result should be one of.flaky— whether the test result should be marked as flaky.
WARNING
This option works with Allure Report 2, which reads the categories.json file that Allure AVA writes into the results directory. Allure Report 3 ignores that file — define the categories in the Allure Report 3 configuration file instead.
environmentInfo
Key-value pairs that will be displayed on the report's main page, see Environment information.
globalLabels
Labels applied to every test result in the run. Useful for tagging all results with a layer, team, or environment identifier without repeating it in every test.
Can be provided as an array of { name, value } label objects:
await installAllure({
globalLabels: [
{ name: "layer", value: "api" },
{ name: "team", value: "backend" },
],
});Or as a plain object mapping label names to values. A name can map to a single string or an array of strings:
await installAllure({
globalLabels: {
layer: "api",
team: "backend",
},
});