{"id":13769273,"url":"https://github.com/zaqqaz/jest-allure","last_synced_at":"2025-04-05T15:10:10.151Z","repository":{"id":32485121,"uuid":"134378301","full_name":"zaqqaz/jest-allure","owner":"zaqqaz","description":"Generate Allure Report for jest. Allure Report, a flexible lightweight multi-language test report tool with the possibility to add steps, attachments, parameters and so on.","archived":false,"fork":false,"pushed_at":"2022-12-07T09:36:56.000Z","size":141,"stargazers_count":114,"open_issues_count":35,"forks_count":38,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-12-06T22:40:54.707Z","etag":null,"topics":["allure","allure-report","jest","jest-reporter","reporting","tests"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zaqqaz.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-05-22T07:38:12.000Z","updated_at":"2024-11-16T00:04:17.000Z","dependencies_parsed_at":"2023-01-14T21:22:05.239Z","dependency_job_id":null,"html_url":"https://github.com/zaqqaz/jest-allure","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zaqqaz%2Fjest-allure","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zaqqaz%2Fjest-allure/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zaqqaz%2Fjest-allure/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zaqqaz%2Fjest-allure/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zaqqaz","download_url":"https://codeload.github.com/zaqqaz/jest-allure/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247353749,"owners_count":20925329,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["allure","allure-report","jest","jest-reporter","reporting","tests"],"created_at":"2024-08-03T17:00:20.894Z","updated_at":"2025-04-05T15:10:10.122Z","avatar_url":"https://github.com/zaqqaz.png","language":"TypeScript","funding_links":[],"categories":["TypeScript","Packages"],"sub_categories":["Reporters"],"readme":"# Jest-Allure reporting plugin\n\n#### Add more power to your tests using Jest-Allure. Easily generate nice reports at the end of the execution.\n[![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/jest-community/awesome-jest)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)\n\n[![GitHub followers](https://img.shields.io/github/followers/zaqqaz.svg?style=social)](https://github.com/zaqqaz)\n[![GitHub stars](https://img.shields.io/github/stars/zaqqaz/jest-allure.svg?style=social)](https://github.com/zaqqaz/jest-allure/stargazers)\n[![GitHub watchers](https://img.shields.io/github/watchers/zaqqaz/jest-allure.svg?style=social)](https://github.com/zaqqaz/jest-allure/watchers)\n#### Examples\n- [Report example](https://103-170502579-gh.circle-artifacts.com/0/Report/Allure/index.html)\n- [Visual unit tests with allure report. Demo project](https://github.com/zaqqaz/visual-unit-tests)\n- [Simple integration test](https://github.com/zaqqaz/jest-allure/blob/master/examples/__tests__/test1.js)\n\n\u003chr\u003e\n\n![Allure Report](https://user-images.githubusercontent.com/2823336/40350093-59cad576-5db1-11e8-8210-c4db3bf825a1.png)\n\n[Allure Framework](https://github.com/allure-framework/allure2) is a flexible lightweight multi-language test report tool that not only\nshows a very concise representation of what have been tested in a neat web report form,\nbut allows everyone participating in the development process to extract maximum of useful\ninformation from everyday execution of tests.\n\n#### Installation\n\n```\nyarn add -D jest-allure\n```\nor\n\n```\nnpm install --save-dev jest-allure\n```\n\n\n## Uses Jest-circus or jest -v \u003e27 ?\n\nJest-allure doesn't support jest-circus. (but PR's are welcome)\n\n**As starting from jest@27 it uses jest-circus as default testrunner you must update jest.config.js and set:**\n\n``` \n\"testRunner\": \"jest-jasmine2\"\n```\n\n### jest -v \u003e24 ?\nThen add `jest-allure/dist/setup` to `setupFilesAfterEnv` section of your config.\n\n```\nsetupFilesAfterEnv: [\"jest-allure/dist/setup\"]\n```\n\n### jest -v \u003c 24 ?\n\n#### add reporter to jest.config.js\n```\nreporters: [\"default\", \"jest-allure\"],\n```\n\nRun your tests and enjoy 🥤🚀\n\n---\n\n#### How to get a report\n\nYou need to install the [CLI](https://github.com/allure-framework/allure2#download) in order to obtain a report.\n\nTo see a report in browser, run in console\n\n```\nallure serve\n```\n\nIf you want to generate html version, run in console\n\n```\nallure generate\n```\n\n# Advanced features\nYou can add description, screenshots, steps, severity and lots of other \nfancy stuff to your reports.\n\nGlobal variable `reporter` available in your tests with such methods:\n\n```\n    description(description: string): this;\n    severity(severity: Severity): this;\n    epic(epic: string): this;\n    feature(feature: string): this;\n    story(story: string): this;\n    startStep(name: string): this;\n    endStep(status?: Status): this;\n    addArgument(name: string): this;\n    addEnvironment(name: string, value: string): this;\n    addAttachment(name: string, buffer: any, type: string): this;\n    addLabel(name: string, value: string): this;\n    addParameter(paramName: string, name: string, value: string): this;\n```\n**Example**\n\n```\nimport { Severity } from \"jest-allure/dist/Reporter\";\nimport { Feature } from \"somwhere in your project\";\n\ndescribe(\"Fancy test\", () =\u003e {\n        ...\n        \n        it(\"Test your amazing feature\", async () =\u003e {\n            reporter\n                .description(\"Feature should work cool\")\n                .severity(Severity.Critical)\n                .feature(Feature.Betting)\n                .story(\"BOND-007\");\n\n            reporter.startStep(\"Check it's fancy\");\n            // expect that it's fancy\n            reporter.endStep();\n            \n            reporter.startStep(\"Check it's cool\");\n            // expect that it's cool\n            reporter.endStep();\n\n            const screenshotBuffer = await page.screenshot();\n            reporter.addAttachment(\"Screenshot\", screenshotBuffer, \"image/png\");\n        });\n        \n        ...\n    }\n);\n\n```\n#### What's next\n\n- [x] Generate report from Jest results\n- [x] Add steps support\n- [x] Add labels support\n- [x] Add attachments support\n- [x] Add more examples\n\n---\n\n#### Additional projects\n[visual-unit-tests](https://github.com/zaqqaz/visual-unit-tests)\n\n[jest-allure-image-snapshot](https://github.com/zaqqaz/jest-allure-image-snapshot)\n\n#### Warning\n``jest-allure`` reporter dynamically configure \"setupTestFrameworkScriptFile\" option in Jest configuration.\n**If you have your own setupTestFrameworkScriptFile file**, you need to manually register allure reporter, for it you need to import jest-allure/dist/setup.\n\n```typescript\nimport \"jest-allure/dist/setup\";\n```\n\nIn case if you have jest version \u003e 24 just add `jest-allure/dist/setup` to `setupFilesAfterEnv` section of your config.\n\n## Contributors\n| [\u003cimg src=\"https://avatars3.githubusercontent.com/u/2823336?s=460\u0026v=4\" width=\"100px;\"/\u003e\u003cbr/\u003e\u003csub\u003e\u003cb\u003eDenis Artyuhovich\u003c/b\u003e\u003c/sub\u003e](https://denis.by) | [\u003cimg src=\"https://avatars1.githubusercontent.com/u/7804416?s=460\u0026v=4\" width=\"100px;\"/\u003e\u003cbr/\u003e\u003csub\u003e\u003cb\u003eDmitry Bogomya\u003c/b\u003e\u003c/sub\u003e](https://github.com/bogomya) |\n| ---      | ---       |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzaqqaz%2Fjest-allure","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzaqqaz%2Fjest-allure","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzaqqaz%2Fjest-allure/lists"}