Allure Mocha configuration

To specify the directory where Allure Mocha will save the test results, set the resultsDir reporter option in the script or configuration file that you use for running Mocha tests.

JavaScript
const glob = require("glob"); const Mocha = require("mocha"); const mocha = new Mocha({ parallel: false, reporter: "allure-mocha", reporterOptions: { resultsDir: "allure-results", }, }); glob.sync("test/**/*.spec.js").forEach((file) => mocha.addFile(file)); mocha.run((failures) => process.exit(failures === 0 ? 0 : 1));
JavaScript
module.exports = { parallel: false, reporter: "allure-mocha", reporterOptions: { resultsDir: "allure-results", }, };
YAML
parallel: false reporter: allure-mocha reporterOptions: resultsDir: ../allure-results
JSON
{ "parallel": false, "reporter": "allure-mocha", "reporterOptions": { "resultsDir": "allure-results" } }
JSON
{ // ... "mocha": { "parallel": false, "reporter": "allure-mocha", "reporterOptions": { "resultsDir": "allure-results" } } }
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.