JavaScript / TypeScript

Test Suite Monitoring for Jest

Monitor your Jest test suite health with TestGlance

Get Started in 3 Steps

  1. 1Install the jest-junit reporter: `npm install --save-dev jest-junit`
  2. 2Configure Jest to output JUnit XML by adding `reporters: ["default", "jest-junit"]` to your jest.config.js
  3. 3Add the TestGlance GitHub Action to your CI workflow to report results automatically

Reporter Configuration

// jest.config.js
module.exports = {

  reporters: ['default', 'jest-junit'],

};

// Environment variable (add to CI workflow):
// JEST_JUNIT_OUTPUT_DIR=test-results

Install first: npm install --save-dev jest-junit

GitHub Actions Workflow

# .github/workflows/test.yml
name: Tests
on: [push, pull_request]
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 20
      - run: npm ci
      - name: Run tests
        run: npx jest --ci --reporters=default --reporters=jest-junit
      - name: Report to TestGlance
        if: always()
        uses: testglance/action@v1
        with:
          api-key: ${{ secrets.TESTGLANCE_API_KEY }}
          report-path: test-results/junit.xml

What You Get

  • Flaky test detection — automatically identify tests that pass and fail intermittently
  • Duration trends — track which tests are getting slower over time
  • Health score — a single metric summarizing your test suite reliability
  • CI summary — rich test result summaries directly in your GitHub Actions runs

FAQ

How do I generate JUnit XML reports from Jest?

Install jest-junit with `npm install --save-dev jest-junit`, then add it to your Jest config reporters array. Set the JEST_JUNIT_OUTPUT_DIR environment variable to control where the XML file is written.

Does TestGlance work with Jest in monorepos?

Yes. Point the report-path to wherever your Jest JUnit XML files are written. If you run multiple Jest projects, you can use glob patterns or run the action multiple times.

Can I track Jest test duration trends?

Yes. TestGlance automatically tracks test durations from the JUnit XML report, showing duration trends and highlighting tests that are getting slower over time.

How does TestGlance detect flaky Jest tests?

TestGlance analyzes test results across runs. If a test alternates between passing and failing without code changes, it is flagged as flaky with a confidence score.

Start Monitoring Your Jest Tests

Free to get started. Set up in under 5 minutes.

Get Started

Other Frameworks