@calimatic-testops/jest-reporter
v0.3.0
Published
Jest reporter that streams test results to Calimatic TestOps
Maintainers
Readme
@calimatic-testops/jest-reporter
Jest custom reporter that streams test results to Calimatic TestOps.
Install
npm install --save-dev @calimatic-testops/jest-reporterQuick Start
Add the reporter to your jest.config.js:
module.exports = {
reporters: [
'default',
['@calimatic-testops/jest-reporter', {
launchName: 'Unit Tests',
layers: ['unit'],
}],
],
};Set the required environment variables in your CI:
TESTOPS_URL=https://testops.calimatic.com
TESTOPS_TOKEN=ttok_your_token_here
TESTOPS_PROJECT=your-project-slugThe reporter silently disables itself when these are missing, so local runs are unaffected.
Options
| Option | Type | Default | Description |
| ------------ | -------- | ---------------- | ----------------------------------------------- |
| url | string | TESTOPS_URL | TestOps server URL |
| token | string | TESTOPS_TOKEN | API token |
| project | string | TESTOPS_PROJECT| Project slug |
| layers | string[] | TESTOPS_LAYERS | Test layers shown in dashboard (e.g. ['unit'])|
| source | string | "jest-reporter"| Source identifier |
| launchName | string | "Jest Run" | Name shown in dashboard |
| attributes | object | — | Extra metadata attached to the launch |
| flushSize | number | 100 | Batch size for result uploads |
| silent | boolean | true | Silently disable when config is missing |
Setting Test Layers
The layers option controls what appears in the Layers column on the TestOps dashboard. Set it to match the type of tests the configuration runs:
// jest.config.unit.js
reporters: [
'default',
['@calimatic-testops/jest-reporter', { layers: ['unit'] }],
]
// jest.config.integration.js
reporters: [
'default',
['@calimatic-testops/jest-reporter', { layers: ['integration'] }],
]You can also set layers via the TESTOPS_LAYERS environment variable (comma-separated):
TESTOPS_LAYERS=unit,integrationEnvironment Variables
| Variable | Description |
| ------------------------ | -------------------------------------------------------- |
| TESTOPS_URL | TestOps server URL (required) |
| TESTOPS_TOKEN | API token from Settings > CLI Tokens (required) |
| TESTOPS_PROJECT | Project slug (required) |
| TESTOPS_LAYERS | Comma-separated test layers, e.g. "unit,integration" |
| TESTOPS_SOURCE | Source identifier override |
| TESTOPS_ENVIRONMENT | Environment name (e.g. "staging", "ci") |
| TESTOPS_CORRELATION_ID | Group multiple suites under one logical run |
How It Works
- Non-fatal: Reporter errors never break your test run. Tests always pass or fail on their own merits.
- Parallel-safe: Works correctly with Jest's
--maxWorkersparallel execution. - Buffered uploads: Results are batched and sent efficiently.
- CI auto-detection: Git branch, commit, PR number, and CI run URL are automatically detected from GitHub Actions, GitLab CI, CircleCI, and other providers.
License
Private — Calimatic Technologies
