Registry / testing / jest-circus-allure-environment

jest-circus-allure-environment

JSON →
library1.1.1jsnpmunverified

Jest test environment (v1.1.1, last updated June 2021) that integrates Allure reporting with Jest Circus test runner. Generates Allure result files for rich test reports. Key differentiator: enables Allure annotations via JSDoc pragmas directly in test files. Requires Allure CLI to serve reports. Ships TypeScript types. Maintained by community, low release cadence. Alternative to allure-jest.

npm install jest-circus-allure-environment
INSTALL
IMPORT
SIG · JEST-CIRCUS-ALLURE
J
jest-circus-allure-environment
testingjavascriptv1.1.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default (environment)
module.exports = { testEnvironment: 'jest-circus-allure-environment' }
import { JestCircusAllureEnvironment } from 'jest-circus-allure-environment'
Configure as testEnvironment in jest.config.js, not imported directly.
setup import
import 'jest-circus-allure-environment'
import { jestCircusAllureEnvironment } from 'jest-circus-allure-environment'
Import for TypeScript type augmentation in jest.setup.js. No named export.
require setup
require('jest-circus-allure-environment')
const { AllureEnvironment } = require('jest-circus-allure-environment')
CommonJS import for setup file. No destructuring.

Configures Jest with Allure environment, sets up type augmentation, uses JSDoc pragma in test.

// jest.config.js module.exports = { testEnvironment: 'jest-circus-allure-environment', testRunner: 'jest-circus/runner', } // jest.setup.js import 'jest-circus-allure-environment' // some.test.js test('example', () => { /** * @severity critical * @tag smoke */ expect(true).toBe(true) }) // Run: npx jest // Generate report: allure serve ./allure-results
Debug
Known issues
breakingIn v1.0.0, environment option 'categoryDefinitions' renamed to 'categories'.
fix
Rename 'categoryDefinitions' to 'categories' in jest.config.js environmentOptions.
affects: >=1.0.0
deprecatedOld v0.x behavior for 'testPath' config option is default in v1.x.
fix
No action needed; just leave 'testPath' if you want per-test results.
affects: >=1.0.0
gotchaMust use 'jest-circus/runner' as testRunner, not default Jasmine runner.
fix
Set testRunner: 'jest-circus/runner' in jest.config.js.
affects: >=0.13.0
gotchaAllure CLI (Java) required to generate HTML report; node module does not serve reports.
fix
Install Allure CLI and run 'allure serve ./allure-results'.
affects: *
gotchaDocblock pragmas must be inside the test function body, not outside.
fix
Place /** @tag foo */ inside the callback function of test() or describe().
affects: *
Errors
Common errors & fixes
Cannot find module 'jest-circus-allure-environment' from 'jest.config.js'
Package not installed or testEnvironment path incorrect.
fix
Run 'npm install --save-dev jest-circus-allure-environment' and ensure testEnvironment string is correct.
TypeError: jestCircusAllureEnvironment is not a constructor
Importing named export instead of setting testEnvironment string.
fix
Use 'testEnvironment: "jest-circus-allure-environment"' in config, do not import directly.
Allure .json files not generated after tests
Allure environment not loaded or testRunner not set.
fix
Ensure testEnvironment and testRunner are set in jest.config.js as shown in quickstart.
allure: command not found
Allure CLI not installed.
fix
Install Allure CLI (Java): see https://docs.qameta.io/allure-report/#_installing_a_commandline
Upgrade
Version history
1.1.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
11 hits · last 30 days
node
10
OpenAI (training)
1
Resources
jest-circus-allure-environment — npm install jest-circus-allure-environment · libregistry