Allure integration Jasmine framework
- Learn more about Allure Report at https://allurereport.org
- 📚 Documentation – discover official documentation for Allure Report
- ❓ Questions and Support – get help from the team and community
- 📢 Official annoucements – be in touch with the latest updates
- 💬 General Discussion – engage in casual conversations, share insights and ideas with the community
For usage example see test/Setup.ts
Use your favorite node package manager to install required packages:
npm add -D jest-jasmine2 allure-jasmine allure-js-commons @types/jasmine
Create allure-setup.ts
file:
import { JasmineAllureReporter } from "allure-jasmine";
import { JasmineAllureInterface } from "allure-jasmine/dist/src/JasmineAllureReporter";
const reporter = new JasmineAllureReporter({ resultsDir: "allure-results" });
jasmine.getEnv().addReporter(reporter);
// @ts-expect-error
global.allure = reporter.getInterface();
declare global {
const allure: JasmineAllureInterface;
}
Change your jest.config.js
file:
module.exports = {
preset: "ts-jest",
+ testRunner: "jest-jasmine2",
+ setupFilesAfterEnv: ["./allure-setup.ts"],
};
You can find example setup and usage in this repo