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.
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
Method 1: Environment Variables (Recommended 👍)
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 📋
Option | What It Does | Required? |
---|---|---|
projectId | Links results to your TestPig.io project | ✅ Yes |
runId | Groups tests under a single run identifier | ❌ No |
apiKey | Your secure access key to TestPig.io | ✅ Yes |
Troubleshooting Made Easy 🔍
Having issues? Let's fix them:
- API Key Issues: Double-check that your key is correct and active
- Project ID Confusion: Verify you're using the right project identifier
- Network Problems: Make sure your environment allows connections to TestPig.io
- Reporter Errors: Check Jest logs for helpful error messages
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 🏆
- Security First: Always use environment variables for API keys
- Smart Naming: Create meaningful run IDs that reflect your CI/CD pipeline
- Automate Everything: Leverage your CI/CD environment variables
- Stay Updated: Regularly update the reporter for new features
- Debug Mode: Use the
--verbose
flag when troubleshooting
Getting Help
If you encounter issues with the Jest reporter:
- Check the Jest Reporter GitHub repository for reporter-specific code issues
- Visit support.testpig.io for all bugs, feature requests, account or technical issues
Ready to see your Jest tests in a whole new light? Let's go! 🚀