Skip to main content

Jest Jest Reporter

Make your Jest test results shine in TestPig.io! Our Jest reporter seamlessly delivers your test results to your dashboard, giving you powerful insights with minimal setup.

Perfect Match

Jest + TestPig.io = Unbeatable test reporting!

Quick Installation ⚡

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

Configuration 🛠️

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

First, add the TestPig.io reporter to your jest.config.js:

module.exports = {
reporters: [
'default',
'@testpig/jest-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 Jest config remains clean with just the reporter definition as shown above.

Method 2: Configuration File Options

Alternatively, specify credentials directly in your jest.config.js:

module.exports = {
reporters: [
'default',
['@testpig/jest-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 jest

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

Troubleshooting Made Easy 🔍

Having issues? Let's fix them:

  1. API Key Issues: Double-check that your key is correct and active
  2. Project ID Confusion: Verify you're using the right project identifier
  3. Network Problems: Make sure your environment allows connections to TestPig.io
  4. Reporter Errors: Check Jest logs for helpful error messages
Common Mistake

The most common issue is an expired API key. If you're getting authentication errors, generate a fresh key from your organization settings!

Best Practices for Pro Users 🏆

  1. Security First: Always use environment variables for API keys
  2. Smart Naming: Create meaningful run IDs that reflect your CI/CD pipeline
  3. Automate Everything: Leverage your CI/CD environment variables
  4. Stay Updated: Regularly update the reporter for new features
  5. Debug Mode: Use the --verbose flag when troubleshooting

Getting Help

If you encounter issues with the Jest reporter:

Ready to see your Jest tests in a whole new light? Let's go! 🚀