Skip to content

Vitest

The official Flakiness.io reporter for Vitest. The open source implementation is available at github.com/flakiness/vitest.

A custom Vitest reporter that generates Flakiness Reports from your Vitest test runs. The reporter automatically converts Vitest test results into the standardized Flakiness JSON format, capturing test outcomes, system utilization, and environment information.

  1. Install the Flakiness.io Vitest reporter:

    Terminal window
    npm install -D @flakiness/vitest
  2. Configure the reporter in your vitest.config.ts file:

    vitest.config.ts
    import { defineConfig } from 'vitest/config';
    export default defineConfig({
    test: {
    includeTaskLocation: true,
    reporters: [
    'default',
    ['@flakiness/vitest', { flakinessProject: 'my-org/my-project' }]
    ],
    },
    });
  3. Run your tests. The report will be automatically generated in the ./flakiness-report folder:

    Terminal window
    npx vitest run
  4. View the interactive report:

    Terminal window
    npx flakiness show ./flakiness-report

Reports are automatically uploaded to Flakiness.io at the end of each test run when authentication is configured. If no credentials are present, the report is still generated locally and can be uploaded manually later.

When uploading succeeds, you’ll see a confirmation in your terminal:

45 passed (1.5m)
[flakiness.io] ✓ Uploaded as https://flakiness.io/flakiness/flakiness/run/6574
Upload MethodStatusGuide
GitHub OIDCSupportedGitHub Actions
Access TokenSupportedGitHub Actions
Other CISupportedOther CI Providers

For a full list of configuration options, see the reporter README on GitHub.