Registry / testing / jest-teamcity

jest-teamcity

JSON →
library1.12.0jsnpmunverified

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.

npm install jest-teamcity
INSTALL
IMPORT
SIG · JEST-TEAMCITY
J
jest-teamcity
testingjavascriptv1.12.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

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

jest-teamcity
// jest.config.js module.exports = { reporters: ["default", "jest-teamcity"] };
const reporter = require('jest-teamcity'); // This package is not for direct JS import
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.

Demonstrates how to install `jest-teamcity`, configure it in Jest, and enable its output via an environment variable for local testing or CI.

npm install --save-dev jest-teamcity // jest.config.js module.exports = { "reporters": ["default", "jest-teamcity"] }; // package.json // ... // "scripts": { // "test": "jest" // } // ... // To run locally with TeamCity output enabled: // In your terminal before running tests: export TEAMCITY_VERSION="some_version" # Then run your tests npm test
Debug
Known issues
gotchaThe `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.
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.
affects: >=1.0.0
breakingVersion 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.
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.
affects: >=1.7.0
gotchaPrior 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.
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.
affects: <1.10.0
gotchaIt 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.
fix
Always include `"default"` as the first entry in your Jest `reporters` array unless you specifically intend to suppress standard console output.
affects: >=1.0.0
Errors
Common errors & fixes
Cannot find module 'jest-teamcity' from 'jest-config/build/isValidReporter.js'
The `jest-teamcity` package is not installed or is incorrectly referenced in the Jest configuration.
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.
Jest tests ran successfully, but no TeamCity service messages appeared in the CI log.
The `TEAMCITY_VERSION` environment variable was not set, which disables the `jest-teamcity` reporter's output.
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.
TeamCity reports incomplete or malformed test suite data after test failures.
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.
fix
Upgrade to `jest-teamcity` version 1.10.0 or newer to ensure proper handling of all test suite states.
Upgrade
Version history
1.12.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
jest-teamcity — npm install jest-teamcity · libregistry