Jest Circus Allure Environment
A Jest Circus environment for Allure reporting.
Requirements
Resource | Description |
---|
Jest | A delightful JavaScript testing framework. |
Allure 2 CLI | "A Java jar command line tool that turns Allure result files into beautiful Allure reports." |
:rocket: Quick start
- Add this package
yarn add --dev jest-circus-allure-environment
- Update
jest.config.js
See the testEnvironment docs for configuration details.
{
"testEnvironment": ["jest-circus-allure-environment"],
"testRunner": "jest-circus/runner"
}
- Run tests
yarn test
- Open the Allure report
allure serve ./allure-results
Allure reporting in your tests
To provide more information in your reports you can call allure from your tests. For types support you'll need some additional configuration.
test('2 + 3 is 5', () => {
allure.epic('Implement addition functionality')
allure.tag('Accounting')
expect(2 + 3).toBe(5)
})
Typescript & Intellisense setup
- Support Typescript & intellisense by loading the module into your
jest.setup.js
file
import 'jest-circus-allure-environment'
require('jest-circus-allure-environment')
- Make sure your
jest.setup.js
file is properly configured.
See the setupFilesAfterEnv docs for configuration details.
{
"setupFilesAfterEnv": ["./jest.setup.js"]
}