Skip to content

testream/jest-jira-reporter

Repository files navigation

Jest Jira Reporter: Send Jest Test Results to Jira with Testream

This repository is a practical Jest + Jira integration example using @testream/jest-reporter. It shows how to upload Jest test results from local runs and GitHub Actions to Jira via Testream.

If you are searching for "Jest Jira reporter", "Jest GitHub Actions Jira integration", or "send Jest results to Jira", this repo is the implementation template.

Why this example is useful

  • CI-ready: Includes a complete GitHub Actions workflow.
  • Fast setup: Reporter auto-detects most CI metadata.
  • Safe defaults: Upload is enabled only when TESTREAM_API_KEY exists.
  • Real failure triage: Intentional failing tests demonstrate Jira-visible errors.

What is Testream?

Testream is an automated test management and reporting platform for Jira teams. It ingests test runs from frameworks like Jest, Vitest, Playwright, and Cypress, then provides failure diagnostics, trends, and release-level quality visibility in Jira.

If this sample repository is not the framework you need, browse all native reporters in the Testream docs: https://docs.testream.app/.

Watch Testream in action

Click to see how Testream turns raw CI test results into actionable Jira insights (failures, trends, and release visibility):
Watch the video

Install Testream Automated Test Management and Reporting for Jira in your Jira workspace to view uploaded runs.

Project structure

src/
  cart.ts          - Cart class and checkout behavior
  product.ts       - Product validation and pricing helpers
  discount.ts      - Coupon validation and discount functions
__tests__/
  cart.test.ts     - Cart tests (passing + 1 intentional failure)
  product.test.ts  - Product tests (passing + 1 intentional failure)
  discount.test.ts - Discount tests (passing + 1 intentional failure)
jest.config.ts
.github/workflows/jest.yml
.env.example

The intentional failures help you verify exactly how failed Jest runs appear in Testream/Jira.

Quick start: Jest to Jira reporting

1. Create your Testream project and API key

  1. Sign in at testream.app.
  2. Create a project.
  3. Copy your API key.

2. Install dependencies

npm install

3. Configure environment variables

cp .env.example .env

Set at least:

TESTREAM_API_KEY=<your key>

4. Run Jest

npm test

With TESTREAM_API_KEY, results are uploaded automatically. Without it, tests still run and upload is skipped.

Reporter configuration (jest.config.ts)

Key behavior in this example:

  • Reporter is conditionally added only when API key is present.
  • failOnUploadError: true is enabled to prevent silent CI data loss.
  • testEnvironment, appName, appVersion, and testType are explicitly set.
  • CI metadata (branch, commitSha, repositoryUrl, buildNumber, buildUrl) is auto-resolved.

Reporter docs: https://docs.testream.app/reporters/jest

GitHub Actions setup

The workflow at .github/workflows/jest.yml runs on pushes and pull requests to main.

Add this repository secret:

Settings -> Secrets and variables -> Actions -> New repository secret

Name Value
TESTREAM_API_KEY Your Testream API key

Workflow env examples already set:

Variable Example
TESTREAM_APP_VERSION ${{ github.sha }}
TESTREAM_TEST_ENVIRONMENT ci

How results appear in Jira

After connecting Testream to Jira, you get:

  • Dashboard visibility for pass/fail health
  • Failure details with stack traces and assertion diffs
  • Historical trend analytics
  • Jira issue creation directly from failed tests

Troubleshooting

Uploads missing in local runs

  • Confirm .env contains TESTREAM_API_KEY.
  • Re-run tests in a shell session where env vars are loaded.

Uploads missing in CI

  • Confirm TESTREAM_API_KEY exists in GitHub Actions secrets.
  • Check whether the workflow had access to secrets (especially fork PRs).

CI passes but uploads should block the pipeline when broken

  • Keep failOnUploadError: true in jest.config.ts.

FAQ

Is this a demo or production pattern?

It is an example repository with production-style reporter and CI wiring meant to be copied.

Why are there failing tests?

To demonstrate failure triage and Jira issue workflows end-to-end.

Can I run Jest without Testream?

Yes. Jest runs normally without an API key; upload is simply disabled.

Jest Jira reporting alternatives (quick view)

Approach Benefit Tradeoff
Store raw test logs/artifacts Minimal setup Limited Jira-native insights
Build custom uploader scripts Fully custom More maintenance burden
Testream Jest reporter (this repo) Native integration + Jira analytics Requires Testream setup

Related links