The another way to generate test report by using Jasmine-Allure-Reporter which you can put inside package.json and jest.config.json. Here the step to follow:
type this command on console
npm install --save-dev jasmine-allure-reporter
or
yarn add -D jest-allure
Create file jest.config.js.
Check your jest version.
If your jest -v > 24, then add this:
module.exports = { setupFilesAfterEnv: ["jest-allure/dist/setup"], };
If your jest -v < 24, then add this:
reporters: ["default", "jest-allure"],
then Run your tests and enjoy!
after that, install CLI by typing this command in console
npm install –-save-dev jest-cli
To see a report in browser, run in console
allure serve
If you want to generate html version, run in console
allure generate
Finally, you can see your test report on browser, it looks like this:
Hope it useful for you, fellas!
Thank you.
-ai-
Comments