Skip to main content

Vitest Vitest Reporter

Send your Vitest test results directly to TestPig.io! Our Vitest reporter seamlessly delivers your test results to your dashboard, giving you powerful insights with minimal setup.

Perfect Match

Vitest + TestPig.io = Supercharged test reporting!

Quick Installation ⚡

npm install @testpig/vitest-reporter --save-dev

Configuration 🛠️

Step 1: Add the Reporter to Your Configuration File (Required)

First, add the TestPig.io reporter to your Vitest configuration in vite.config.js or vitest.config.js:

export default {
test: {
reporters: [
'default',
'@testpig/vitest-reporter'
]
}
}

Step 2: Point Reporter to TestPig

Set these environment variables for maximum flexibility:

export TESTPIG_PROJECT_ID=your-project-id
export TESTPIG_RUN_ID=your-run-id # Optional
export TESTPIG_API_KEY=your-api-key

Your Vitest config remains clean with just the reporter definition as shown above.

Method 2: Configuration File Options

Alternatively, specify credentials directly in your configuration file:

export default {
test: {
reporters: [
'default',
['@testpig/vitest-reporter', {
projectId: 'your-project-id',
runId: 'your-run-id', // Optional
apiKey: 'your-api-key'
}]
]
}
}

Using It Is a Breeze 🌬️

Run your tests exactly like you normally would:

npm test
# or if you prefer
npx vitest

That's it! Your results will magically appear in your TestPig.io dashboard.

Awesome Features You'll Love ❤️

  • Comprehensive Reporting: Every detail of your tests, beautifully organized
  • Smart Organization: Test suites displayed in an intuitive hierarchy
  • Performance Tracking: See exactly how long each test takes to run
  • Failure Forensics: Detailed error reporting to pinpoint issues
  • Coverage Insights: Track your code coverage alongside test results

Configuration Options At-a-Glance 📋

OptionWhat It DoesRequired?
projectIdLinks results to your TestPig.io project✅ Yes
runIdGroups tests under a single run identifier❌ No
apiKeyYour secure access key to TestPig.io✅ Yes
Want More Options?

Check our Best Practices guide for advanced configuration strategies.

Getting Help

If you encounter issues with the Vitest reporter: