Allure Jest configuration
The Allure Jest adapter behavior can be affected by some configuration options set in your project's jest.config.js
file.
To set the options, define an object under the testEnvironmentOptions
key in config
. For example:
JavaScriptconst config = {
testEnvironment: "allure-jest/node",
testEnvironmentOptions: {
resultsDir: "./build/allure-results",
links: [
{ name: "issue", urlTemplate: "https://issues.example.com/%s" },
{ name: "tms", urlTemplate: "https://tms.example.com/%s" },
],
},
};
module.exports = config;
resultsDir
Path to the directory where Allure Jest 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("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.