{"_id":"@alex_neo/jest-circus-allure-environment","_rev":"2-f010adc452378fece4b3283c6e92762c","name":"@alex_neo/jest-circus-allure-environment","dist-tags":{"latest":"1.2.0"},"versions":{"1.2.0":{"name":"@alex_neo/jest-circus-allure-environment","version":"1.2.0","repository":{"type":"git","url":"git+https://github.com/ryparker/jest-circus-allure-environment.git"},"author":{"name":"Ryan Parker","email":"ryan.parker3@outlook.com"},"license":"MIT","main":"dist","types":"dist/index.d.ts","scripts":{"build":"rimraf dist && tsc","test":"rimraf allure-results && yarn build && jest","lint":"xo src","fix":"xo src --fix"},"jest":{"testEnvironment":"./dist","testRunner":"jest-circus/runner","logHeapUsage":true},"xo":{"globals":["allure"],"rules":{"promise/prefer-await-to-then":1,"@typescript-eslint/no-unsafe-call":1,"@typescript-eslint/no-unsafe-member-access":1,"@typescript-eslint/no-unsafe-argument":1,"@typescript-eslint/no-unsafe-return":1,"@typescript-eslint/no-require-imports":1,"@typescript-eslint/no-unused-vars":1,"@typescript-eslint/no-unsafe-assignment":1,"unicorn/prefer-node-protocol":0},"extends":["plugin:jest/recommended"]},"husky":{"hooks":{"pre-commit":"lint-staged","pre-push":"yarn lint"}},"lint-staged":{"./src/**/*":["xo src --fix"]},"release":{"branches":["main"],"plugins":[["@semantic-release/commit-analyzer",{"preset":"conventionalcommits","config":"./node_modules/cz-conventional-changelog"}],["@semantic-release/changelog",{"changelogTitle":"# Changelog"}],"@semantic-release/release-notes-generator","@semantic-release/npm","@semantic-release/git","@semantic-release/github"]},"resolutions":{"mem":"^4.0","yargs-parser":"^13.1.2"},"dependencies":{"@jest/environment":"^27.0.3","@jest/reporters":"^27.0.2","@jest/types":"^27.0.2","allure-js-commons":"2.0.0-beta.9","ansi_up":"^5.0.1","jest-circus":"^27.0.3","jest-docblock":"^27.0.1","jest-environment-node":"^27.0.3","lodash":"^4.17.21","prettier":"^2.3.0","pretty-format":"^27.0.2","strip-ansi":"^6.0.0"},"devDependencies":{"@semantic-release/changelog":"^5.0.1","@semantic-release/git":"^9.0.0","@types/allure-js-commons":"^0.0.1","@types/highlight.js":"^10.1.0","@types/jest":"^26.0.23","@types/lodash":"^4.14.170","@types/node":"^15.6.2","commitizen":"^4.2.4","conventional-changelog-conventionalcommits":"^4.6.0","cz-conventional-changelog":"3.3.0","eslint-config-xo-typescript":"^0.41.1","eslint-plugin-jest":"^24.3.6","husky":"^6.0.0","jest":"^27.0.3","lint-staged":"^11.0.0","semantic-release":"^17.4.3","typescript":"^4.3.2","xo":"^0.40.2"},"engines":{"node":">=12.x"},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"keywords":["jest","circus","reporter","allure","environment","detailed","reports","collect","analyze"],"description":"[![jest](https://jestjs.io/img/jest-badge.svg)](https://github.com/facebook/jest)\r ![Lint-Build-Test-Publish](https://github.com/ryparker/jest-circus-allure-reporter/workflows/Lint-Build-Test-Publish/badge.svg)\r [![XO code style](https://img.shields.io/ba","bugs":{"url":"https://github.com/ryparker/jest-circus-allure-environment/issues"},"homepage":"https://github.com/ryparker/jest-circus-allure-environment#readme","gitHead":"b721025c0d95f35010d67c91ecb40e7b1c5b2b7b","_id":"@alex_neo/jest-circus-allure-environment@1.2.0","_nodeVersion":"14.16.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-wbDpKPNf4DpfqkkZlmDbhfBbGXLH+VTS3V8TVH5YAl9G6pLUmoxLa81RCtWhdODYIzGANi0dIwHasisD9Z0JxA==","shasum":"76b61a0243eddb417d093d29af00eb4f84328ce3","tarball":"https://registry.npmjs.org/@alex_neo/jest-circus-allure-environment/-/jest-circus-allure-environment-1.2.0.tgz","fileCount":25,"unpackedSize":92934,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhxI4vCRA9TVsSAnZWagAA14wQAIEsHfVXCRIqe+ZvzI6X\nuH4M62voYEl1SAPQ0nh3yiYO2ue3dO7x1O8dKGVPuxMcWXxNfgmCIFpwJF7j\nxg/C2t3dInUZsm57e7jOOq7OwUJHjWikgpfU0DlM31bsK3LoIMCSCZxAsnGU\nO/XXoXPFSE+/RpD7GFtbmnIEJrg3AlqfDDm8G0Ps9U3Nzi1cSWMi3nv/deVP\nEv7nClbFHGsZihEse3K+DTQD/GWY7XETUUABXbGZHd8dFuRMxRJQdjOjDuik\nLTRmGo5e5OflpWSwZcYhAwpu5vmUG2LDvmp+kQ6tRtnBzs+kXUuwuY8cD56n\nQti2WUbpSDAI+YCo57bB42/EeTnwarDJVcm+vgB9WfupVie5BIW//1qUwr6m\nvWxLViYAxYXSPlOLbJqIVB7JeQz0hxuzC+TrVb0WaPLHdlf8C3Tu1OkQqYpX\nQ7UXxO0ZcZf3QqghN4UbKLPeBMbcVFp1hjPkSv/Lqz688UZbe1zDU1tm3Kbd\n4Ww7wv06HiyUm8yaEmShEsNEwhMUIKQkhjqaNcoXvs/siQ/VoTutT0t/TpNm\ng1iXjeyvKpR80mch9jceNfl/o3DVbt/gJQ473Yb7bCfisZA1UcVjvqCGyfXb\nnQ1QzQ+qzoWgk9Z8cQRqakZzOekXadhMcAHTEZZ/rfYJzanh711x0jiivITH\nIefA\r\n=fWK0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCHXSWPRMiS6AtI1KeU6X3E8SofzuW9hi7ijkQlmdangAIgWZHR1g8EomAsa9YXqgSIXVdkoE8bn/Bnq2/Sb09yswQ="}]},"_npmUser":{"name":"alex_neo","email":"alexneo2003@gmail.com"},"directories":{},"maintainers":[{"name":"alex_neo","email":"alexneo2003@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jest-circus-allure-environment_1.2.0_1634806134794_0.23414363357858514"},"_hasShrinkwrap":false}},"time":{"created":"2021-10-21T08:48:54.748Z","1.2.0":"2021-10-21T08:48:54.920Z","modified":"2022-04-04T12:38:38.962Z"},"maintainers":[{"name":"alex_neo","email":"alexneo2003@gmail.com"}],"description":"[![jest](https://jestjs.io/img/jest-badge.svg)](https://github.com/facebook/jest)\r ![Lint-Build-Test-Publish](https://github.com/ryparker/jest-circus-allure-reporter/workflows/Lint-Build-Test-Publish/badge.svg)\r [![XO code style](https://img.shields.io/ba","homepage":"https://github.com/ryparker/jest-circus-allure-environment#readme","keywords":["jest","circus","reporter","allure","environment","detailed","reports","collect","analyze"],"repository":{"type":"git","url":"git+https://github.com/ryparker/jest-circus-allure-environment.git"},"author":{"name":"Ryan Parker","email":"ryan.parker3@outlook.com"},"bugs":{"url":"https://github.com/ryparker/jest-circus-allure-environment/issues"},"license":"MIT","readme":"# Jest Circus Allure Environment\r\n\r\n[![jest](https://jestjs.io/img/jest-badge.svg)](https://github.com/facebook/jest)\r\n![Lint-Build-Test-Publish](https://github.com/ryparker/jest-circus-allure-reporter/workflows/Lint-Build-Test-Publish/badge.svg)\r\n[![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/xojs/xo)\r\n[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)\r\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\r\n\r\nA Jest Circus environment for Allure reporting.\r\n\r\n![Allure Report](https://user-images.githubusercontent.com/2823336/40350093-59cad576-5db1-11e8-8210-c4db3bf825a1.png)\r\n\r\n---\r\n\r\n- [Jest Circus Allure Environment](#jest-circus-allure-environment)\r\n  - [❗️ Requirements](#️-requirements)\r\n  - [:rocket: Quick start](#rocket-quick-start)\r\n  - [:camera_flash: Allure reporting in your tests](#camera_flash-allure-reporting-in-your-tests)\r\n  - [🔧 Typescript & Intellisense setup](#-typescript--intellisense-setup)\r\n  - [:gear: Options](#gear-options)\r\n  - [📈 DocBlocks](#-docblocks)\r\n    - [🔍 Descriptions](#-descriptions)\r\n    - [🏷 Tag](#-tag)\r\n    - [👥 Owner](#-owner)\r\n    - [:part_alternation_mark: Severity](#part_alternation_mark-severity)\r\n    - [📇 Behaviors (epics, features, stories)](#-behaviors-epics-features-stories)\r\n    - [🔗 Links (Jira and TMS)](#-links-jira-and-tms)\r\n  - [👩‍🎓 Advanced](#-advanced)\r\n    - [🎛 Global Allure API](#-global-allure-api)\r\n\r\n---\r\n\r\n## ❗️ Requirements\r\n\r\n| Resource                                                             | Description                                                                                  |\r\n| -------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |\r\n| [Jest](https://jestjs.io/)                                           | A delightful JavaScript testing framework.                                                   |\r\n| [Allure 2 CLI](https://github.com/allure-framework/allure2#download) | \"A Java jar command line tool that turns Allure result files into beautiful Allure reports.\" |\r\n\r\n## :rocket: Quick start\r\n\r\n1. **Add this package**\r\n\r\n```shell\r\nyarn add --dev jest-circus-allure-environment\r\n```\r\n\r\n2. **Update `jest.config.js`**\r\n\r\n_See the [testEnvironment docs](https://jestjs.io/docs/en/configuration#testenvironment-string) for configuration details._\r\n\r\n```JSON\r\n{\r\n  \"testEnvironment\": \"jest-circus-allure-environment\",\r\n  \"testRunner\": \"jest-circus/runner\"\r\n}\r\n```\r\n\r\n3. **Run tests**\r\n\r\n```shell\r\nyarn test\r\n```\r\n\r\n4. **Open the Allure report**\r\n\r\n```shell\r\nallure serve ./allure-results\r\n```\r\n\r\n## :camera_flash: Allure reporting in your tests\r\n\r\nTo provide more information in your reports you can use Docblock pragmas within your tests. For types support you'll need some [additional configuration](#typescript--intellisense-setup).\r\n\r\n```js\r\n// simple.test.js\r\n\r\ntest('2 + 3 is 5', () => {\r\n  /** My test description.\r\n   * @epic Implement addition functionality\r\n   * @tag Accounting\r\n   */\r\n\r\n  expect(2 + 3).toBe(5)\r\n})\r\n```\r\n\r\n## 🔧 Typescript & Intellisense setup\r\n\r\n1. **Support Typescript & intellisense by loading the module into your `jest.setup.js` file**\r\n\r\n\r\n\r\n```js\r\n// jest.setup.js\r\n\r\nimport 'jest-circus-allure-environment' // Typescript or ESM\r\nrequire('jest-circus-allure-environment') // CommonJS\r\n```\r\n\r\n2. **Make sure your `jest.setup.js` file is properly configured.**\r\n\r\n_See the [setupFilesAfterEnv docs](https://jestjs.io/docs/en/configuration#setupfilesafterenv-array) for configuration details._\r\n\r\n```js\r\n// jest.config.js\r\n\r\n{\r\n  \"setupFilesAfterEnv\": [\"./jest.setup.js\"]\r\n}\r\n```\r\n\r\n## :gear: Options\r\n\r\nOptions that can be passed into the `environmentOptions` property of your `jest.config.js`\r\n\r\n| Parameter       | Description                                                                                                      | Default               |\r\n| --------------- | ---------------------------------------------------------------------------------------------------------------- | --------------------- |\r\n| resultsDir      | Path where Allure result files will be written.                                                                  | `\"allure-results\"`    |\r\n| jiraUrl         | URL to Jira instance. Any `@issue` docblock pragmas will link to this URL.                                       | `undefined`           |\r\n| tmsUrl          | URL to TMS instance. Any `@tms` docblock pragmas will link to this URL.                                          | `undefined`           |\r\n| environmentInfo | Key value pairs that will appear under the environment section of the Allure report                              | `{}`                  |\r\n| categories      | Array of custom categories you wish to see in the Allure report. [See an example](./src/category-definitions.ts) | `[]`                  |\r\n| testPath        | Path to your test files. This path will be subtracted from the Allure report when organizing tests into suites.  | `Jest.config.rootDir` |\r\n\r\n## 📈 DocBlocks\r\n\r\nYou may set code comments inside your tests called DocBlocks, that can be parsed for specific allure report pragmas. These are the supported DocBlock pragmas you may add to a test.\r\n\r\n### 🔍 Descriptions\r\n\r\nAdd descriptions that document the tested functionality.\r\n\r\n```TS\r\ntest('does something important, when triggered by user', () => {\r\n  /** This uses a 3rd party API that typically undergoes maintenance on Tuesdays.\r\n   */\r\n\r\n  ...\r\n})\r\n```\r\n\r\n### 🏷 Tag\r\n\r\nTag a test with a custom label.\r\n\r\n_Set multiple tags using a `,` deliminator._\r\n\r\n```TS\r\ntest('does something important, when triggered by user', () => {\r\n  /**\r\n   * @tag beta\r\n   * @tag feature-flagged, api-v3\r\n   */\r\n\r\n  ...\r\n})\r\n```\r\n\r\n### 👥 Owner\r\n\r\nSet an owner for a test.\r\n\r\n```TS\r\ntest('does something important, when triggered by user', () => {\r\n  /**\r\n   * @owner ios-team\r\n   */\r\n\r\n  ..\r\n})\r\n```\r\n\r\n### :part_alternation_mark: Severity\r\n\r\nMark tests with a severity rating to indicate the importance of the tested functionality in respect to the overall application.\r\n\r\n| Level            | Description                                                                  |\r\n| ---------------- | ---------------------------------------------------------------------------- |\r\n| blocker          | Tests that if failing, will halt further development.                        |\r\n| critical         | Tests that must pass; or risk disrupting crucial application logic.          |\r\n| normal (default) | Tests that are of average importance to the overall application.             |\r\n| minor            | Tests that if failing, should only effect a small subset of the application. |\r\n| trivial          | Tests that validate unreleased, disabled, or deprecated features.            |\r\n\r\nExample of setting a test as \"critical\" severity\r\n\r\n```TS\r\ntest('does something important, when triggered by user', () => {\r\n  /**\r\n   * @severity critical\r\n   */\r\n\r\n  ...\r\n})\r\n```\r\n\r\n### 📇 Behaviors (epics, features, stories)\r\n\r\nMark tests with a behavior label to organize tests in a feature based hierarchy.\r\n\r\n| Level   | Description                                                              |\r\n| ------- | ------------------------------------------------------------------------ |\r\n| epic    | Tests that if fail, will effect the expected functionality of an epic.   |\r\n| feature | Tests that if fail, will effect the expected functionality of a feature. |\r\n| story   | Tests that if fail, will effect the expected functionality of story.     |\r\n\r\nExample:\r\n\r\n```TS\r\ntest('validation message appears, when email field is skipped', () => {\r\n  /**\r\n   * @epic Automate user sign up\r\n   * @feature Registration page\r\n   * @story Validate required registration fields before creating new user\r\n   */\r\n\r\n  ...\r\n})\r\n```\r\n\r\n### 🔗 Links (Jira and TMS)\r\n\r\nAdd Jira and TMS links to a test.\r\n\r\n| Level | Description                                                                                         |\r\n| ----- | --------------------------------------------------------------------------------------------------- |\r\n| issue | Adds a link to the test report that will open an existing issue in Jira.                            |\r\n| tms   | Adds a link to the test report that will open an existing test case in your test management system. |\r\n\r\nExample:\r\n\r\n```TS\r\ntest('validation message appears, when email field is skipped', () => {\r\n  /**\r\n   * @issue DEBT-60\r\n   * @tms CORE-122\r\n   */\r\n\r\n  ...\r\n})\r\n```\r\n\r\n## 👩‍🎓 Advanced\r\n\r\n### 🎛 Global Allure API\r\n\r\nAn instance of the allure runtime will be available on the Node global variable. You can utilize it's APIs to provide custom reporting functionality.\r\n\r\n```TS\r\n/**\r\n * Returns the Allure test instance for the currently running test.\r\n */\r\nallure.currentTest(): AllureTest;\r\n\r\n/**\r\n * Adds a description to the report of the current test. Supports markdown.\r\n */\r\nallure.description(markdown: string): void;\r\n\r\n/**\r\n * Starts and returns a new step instance on the current executable.\r\n */\r\nallure.startStep(name: string): StepWrapper;\r\n\r\n/**\r\n * Starts a new Allure step, sets the status, and adds any provided attachments (optional), then ends the step.\r\n */\r\nallure.logStep(\r\n  name: string,\r\n  status: Status,\r\n  attachments?: Array<{ name: string; content: string; type: ContentType }>\r\n): void;\r\n\r\n/**\r\n * Add a parameter to the report of the current executable.\r\n */\r\nallure.parameter(name: string, value: string): void;\r\n\r\n/**\r\n * Attach a file to the report of the current executable.\r\n */\r\nallure.attachment(\r\n  name: string,\r\n  content: Buffer | string,\r\n  type: ContentType\r\n);\r\n\r\n/**\r\n * Add a issue link to the report of the current test.\r\n */\r\nallure.issue(id: string): void;\r\n\r\n/**\r\n * Add a TMS link to the report of the current test.\r\n */\r\nallure.tms(id: string): void;\r\n\r\n/**\r\n * Add a severity label to the report of the current test.\r\n */\r\nallure.severity(severity: Severity): void;\r\n\r\n/**\r\n * Add a epic label to the report of the current test.\r\n */\r\nallure.epic(epic: string): void;\r\n\r\n/**\r\n * Add a feature label to the report of the current test.\r\n */\r\nallure.feature(feature: string): void;\r\n\r\n/**\r\n * Add a story label to the report of the current test.\r\n */\r\nallure.story(story: string): void;\r\n\r\n/**\r\n * Add a tag label to the report of the current test.\r\n */\r\nallure.tag(name: string): void;\r\n\r\n/**\r\n * Add a custom label to the report of the current test.\r\n */\r\nallure.label(name: string, value: string): void;\r\n```\r\n","readmeFilename":"README.md"}