{"id":11143,"library":"jest-teamcity","title":"Jest TeamCity Reporter","description":"jest-teamcity is a specialized Jest reporter designed to integrate test results with TeamCity CI/CD servers. Currently at version 1.12.0, this package provides detailed reporting, including test durations, pending test statuses, and full stack traces for failed tests, all formatted using TeamCity's service messages. It automatically groups tests into logical suites, enhancing readability and analysis within TeamCity's interface. Releases are generally infrequent, focusing on maintenance, dependency updates, and addressing specific edge cases or improvements in how Jest's internal APIs or TeamCity's expectations are handled. A key differentiator is its automatic activation based on the `TEAMCITY_VERSION` environment variable, ensuring it only outputs TeamCity-specific messages when running within that environment, while defaulting to standard Jest output otherwise. This prevents noisy output during local development.","status":"active","version":"1.12.0","language":"javascript","source_language":"en","source_url":"git://github.com/itereshchenkov/jest-teamcity","tags":["javascript","jest","teamcity","reporter","tests","unit","unittest","integration","ci"],"install":[{"cmd":"npm install jest-teamcity","lang":"bash","label":"npm"},{"cmd":"yarn add jest-teamcity","lang":"bash","label":"yarn"},{"cmd":"pnpm add jest-teamcity","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"This package is a Jest reporter and is configured via Jest's `reporters` array in `jest.config.js` or `package.json`. It is not imported directly into JavaScript code.","wrong":"const reporter = require('jest-teamcity'); // This package is not for direct JS import","symbol":"jest-teamcity","correct":"// jest.config.js\nmodule.exports = {\n  reporters: [\"default\", \"jest-teamcity\"]\n};"}],"quickstart":{"code":"npm install --save-dev jest-teamcity\n\n// jest.config.js\nmodule.exports = {\n  \"reporters\": [\"default\", \"jest-teamcity\"]\n};\n\n// package.json\n// ...\n// \"scripts\": {\n//     \"test\": \"jest\"\n// }\n// ...\n\n// To run locally with TeamCity output enabled:\n// In your terminal before running tests:\nexport TEAMCITY_VERSION=\"some_version\" \n# Then run your tests\nnpm test","lang":"javascript","description":"Demonstrates how to install `jest-teamcity`, configure it in Jest, and enable its output via an environment variable for local testing or CI."},"warnings":[{"fix":"Ensure `TEAMCITY_VERSION` is defined in your CI/CD environment or locally (e.g., `export TEAMCITY_VERSION=\"some_value\"`) when TeamCity output is desired.","message":"The `jest-teamcity` reporter will only produce TeamCity-specific output if the `TEAMCITY_VERSION` environment variable is set. If this variable is missing, it silently defaults to standard Jest output.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Ensure you are using a compatible Jest version (typically latest stable is recommended) and your `jest.config.js` or `package.json` reporters array is correctly formatted.","message":"Version 1.7.0 refactored the package to use Jest's official reporters API. While the configuration string 'jest-teamcity' remained the same, this change might have required Jest version updates or addressed issues for users on significantly older Jest configurations.","severity":"breaking","affected_versions":">=1.7.0"},{"fix":"Upgrade `jest-teamcity` to version 1.10.0 or newer to ensure robust reporting, especially for edge cases involving test suite setup/teardown failures.","message":"Prior to versions 1.9.0 and 1.10.0, the reporter had known issues handling Jest test suites that failed to run entirely or failures within test suite hooks. This could lead to incomplete or malformed reports in TeamCity.","severity":"gotcha","affected_versions":"<1.10.0"},{"fix":"Always include `\"default\"` as the first entry in your Jest `reporters` array unless you specifically intend to suppress standard console output.","message":"It is common practice to include `\"default\"` alongside `\"jest-teamcity\"` in the `reporters` array (e.g., `[\"default\", \"jest-teamcity\"]`). Omitting `\"default\"` might suppress standard console output from Jest when `TEAMCITY_VERSION` is not set, potentially making local debugging more difficult.","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":"Run `npm install --save-dev jest-teamcity` or `yarn add --dev jest-teamcity`. Verify that 'jest-teamcity' is spelled correctly in your Jest `reporters` array.","cause":"The `jest-teamcity` package is not installed or is incorrectly referenced in the Jest configuration.","error":"Cannot find module 'jest-teamcity' from 'jest-config/build/isValidReporter.js'"},{"fix":"Ensure `TEAMCITY_VERSION` is set in your CI environment or locally (e.g., `export TEAMCITY_VERSION=\"some_version\"` on Linux/macOS or `set TEAMCITY_VERSION=some_version` on Windows) before running tests.","cause":"The `TEAMCITY_VERSION` environment variable was not set, which disables the `jest-teamcity` reporter's output.","error":"Jest tests ran successfully, but no TeamCity service messages appeared in the CI log."},{"fix":"Upgrade to `jest-teamcity` version 1.10.0 or newer to ensure proper handling of all test suite states.","cause":"Older versions of `jest-teamcity` (prior to v1.10.0) might not have properly handled test suite hook failures or suites that failed to run.","error":"TeamCity reports incomplete or malformed test suite data after test failures."}],"ecosystem":"npm"}