JavaScript / TypeScript

Test Suite Monitoring for Vitest

Monitor your Vitest test suite health with TestGlance

Get Started in 3 Steps

  1. 1Add the JUnit reporter to your vitest.config.ts — Vitest has it built in, no extra package needed
  2. 2Configure `outputFile.junit` to write the XML to a known location like `test-results/vitest.xml`
  3. 3Add the TestGlance GitHub Action to your CI workflow

Reporter Configuration

// vitest.config.ts
import { defineConfig } from 'vitest/config';

export default defineConfig({
  test: {

    reporters: process.env.CI ? ['default', 'junit'] : ['default'],
    outputFile: {
      junit: 'test-results/vitest.xml',
    },

  },
});

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 vitest run --reporter=default --reporter=junit
      - name: Report to TestGlance
        if: always()
        uses: testglance/action@v1
        with:
          api-key: ${{ secrets.TESTGLANCE_API_KEY }}
          report-path: test-results/vitest.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

Does Vitest support JUnit XML output natively?

Yes. Vitest includes a built-in JUnit reporter. Add `reporters: ["default", "junit"]` and set `outputFile.junit` in your vitest.config.ts — no extra packages needed.

How do I monitor Vitest tests in a Turborepo monorepo?

Configure each Vitest workspace to output its JUnit XML, then point the TestGlance action to the report paths. You can run multiple action steps or use a glob pattern.

Can TestGlance track Vitest benchmark results?

TestGlance focuses on test pass/fail status and duration. Benchmark results from `vitest bench` are not tracked, but standard test suites run with `vitest run` are fully supported.

Start Monitoring Your Vitest Tests

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

Get Started

Other Frameworks