{"id":12873,"library":"bamboo-jest-reporter","title":"Bamboo Jest Reporter","description":"bamboo-jest-reporter is a Jest test reporter designed to integrate test, coverage, and snapshot results with Atlassian Bamboo's Mocha Test Parser. It transforms Jest's native output into a `jest.json` file, making it consumable by Bamboo. Currently at version 1.0.3, the package appears to be stable with a focus on specific enterprise CI/CD integration. Its key differentiator lies in its tailored output format for Bamboo and granular control over which aspects of Jest's results (tests, code coverage, or obsolete snapshots) are reported as failures, configurable via environment variables, allowing for flexible build pipeline management. This specificity makes it a niche but valuable tool for teams using Jest with Bamboo.","status":"active","version":"1.0.3","language":"javascript","source_language":"en","source_url":"https://github.com/hendrikdp/bamboo-jest-reporter","tags":["javascript","jest","reporter","coverage","snapshots","atlassian","bamboo","mocha"],"install":[{"cmd":"npm install bamboo-jest-reporter","lang":"bash","label":"npm"},{"cmd":"yarn add bamboo-jest-reporter","lang":"bash","label":"yarn"},{"cmd":"pnpm add bamboo-jest-reporter","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"This package is a reporter for Jest and requires Jest to be installed as a development dependency in the consuming project.","package":"jest","optional":false}],"imports":[{"note":"The reporter is configured as a string in Jest's `reporters` array within `jest.config.js` or `package.json`, not directly imported as a module.","wrong":"import { BambooJestReporter } from 'bamboo-jest-reporter'","symbol":"Reporter Configuration","correct":"reporters: [ \"default\", \"bamboo-jest-reporter\" ]"},{"note":"If you do not want Jest's default console output, you can list only `\"bamboo-jest-reporter\"` in the `reporters` array. Do not attempt to `require` or `import` the reporter directly into your code.","wrong":"const reporter = require('bamboo-jest-reporter')","symbol":"Standalone Reporter","correct":"reporters: [ \"bamboo-jest-reporter\" ]"}],"quickstart":{"code":"{\n  \"name\": \"my-project\",\n  \"version\": \"1.0.0\",\n  \"scripts\": {\n    \"test\": \"jest --coverage\"\n  },\n  \"devDependencies\": {\n    \"jest\": \"^29.0.0\",\n    \"bamboo-jest-reporter\": \"^1.0.0\"\n  },\n  \"jest\": {\n    \"collectCoverage\": true,\n    \"coverageDirectory\": \"coverage\",\n    \"reporters\": [ \"default\", \"bamboo-jest-reporter\" ],\n    \"collectCoverageFrom\": [\n      \"src/**/*.js\"\n    ],\n    \"coverageThreshold\": {\n      \"global\": {\n        \"branches\": 80,\n        \"functions\": 80,\n        \"statements\": 80,\n        \"lines\": 80\n      }\n    }\n  }\n}\n\n// To run this example:\n// 1. Save the above JSON into your package.json.\n// 2. Create a 'src' directory with at least one .js file and a corresponding test file (e.g., src/index.js and src/__tests__/index.test.js).\n// 3. Ensure your Jest tests run successfully.\n// 4. Run `npm install`.\n// 5. Execute `npm test`.\n// This will generate a `jest.json` file in your project root.","lang":"javascript","description":"Demonstrates `package.json` configuration for Jest to use `bamboo-jest-reporter` and generate a `jest.json` report, including coverage."},"warnings":[{"fix":"Ensure environment variables are set correctly in your CI/CD environment or explicitly unset them if default reporting is desired. The default behavior is to report all three aspects.","message":"The reporter's behavior for tests, coverage, and obsolete snapshots can be toggled using specific environment variables (JEST_REPORTER_ADD_TESTS, JEST_REPORTER_ADD_COVERAGE, JEST_REPORTER_SNAPSHOTS_ADD_OBSOLETE). If these are inadvertently set to `false`, expected reports might not be generated in `jest.json`, potentially masking failures.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Add `collectCoverage: true` and a `coverageThreshold` object to your `jest.config.js` or `package.json` Jest configuration. Alternatively, run Jest with `jest --coverage`.","message":"For code coverage to be included in the `jest.json` report and for `coverageThreshold` failures to be registered, Jest's `collectCoverage` option must be set to `true` and `coverageThreshold` must be configured in your Jest configuration. Without these, coverage data will be absent.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"For local development or environments where console output is desired, use `reporters: [ \"default\", \"bamboo-jest-reporter\" ]`. Only omit `\"default\"` in CI environments where console output is parsed differently or explicitly not needed.","message":"If you configure Jest with `reporters: [ \"bamboo-jest-reporter\" ]` (omitting `\"default\"`), Jest will not print its standard test output to the console. This can make debugging local test failures difficult as there will be no immediate console feedback.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"This is expected behavior for Bamboo to correctly report test outcomes. If you want the shell command to pass but for Bamboo to show failures in the 'Tests' tab, this setup is correct. To prevent Bamboo from failing the *build* due to test failures, you would need to modify Bamboo's build plan logic, not the reporter.","cause":"Even if an npm test script is configured to `exit 0` on failure, Bamboo's Mocha Test Parser task will still interpret failures reported in `jest.json` as build failures.","error":"The automated jest tests did not pass. Please check the tests-tab (or similar message in Bamboo logs)"},{"fix":"Ensure `collectCoverage: true` is set in your `jest.config.js` or `package.json` Jest configuration, and that a `coverageThreshold` object is defined for desired coverage targets.","cause":"Jest's `collectCoverage` is not enabled, or `coverageThreshold` is not configured in the Jest settings.","error":"Coverage data or thresholds are not appearing in the Bamboo test report."},{"fix":"Verify that `\"bamboo-jest-reporter\"` is present in the `reporters` array within your Jest configuration. Also, confirm that your `npm test` script correctly executes Jest.","cause":"The `bamboo-jest-reporter` is not correctly configured in the Jest reporters array, or Jest tests are not being run.","error":"jest.json file is not being generated or is empty."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null}