What problem does it solve?
This Skill addresses the challenges of creating and managing consistent, reliable, and isolated test data, which is crucial for robust software testing and preventing flaky tests.
Core Features & Use Cases
- Factory Functions: Create dynamic test data using libraries like Faker.js for realistic and varied data generation.
- Fixture Files: Utilize static JSON files for stable, reference data that doesn't change between test runs.
- Database Seeding: Populate development and staging databases with realistic data for testing.
- Test Isolation: Implement patterns like
afterEach cleanup or database transactions to ensure tests don't interfere with each other.
- Flaky Test Prevention: Strategies to avoid common causes of flaky tests, such as async timing issues, test order dependency, and date/time variations.
- Use Case: When developing a new feature, use factory functions to create realistic user and post data to test various scenarios, ensuring your application handles different data states correctly.
Quick Start
Use the test-data skill to generate a new user with factory functions and then create three posts for that user.