test-data

Generates and isolates test data using factories, fixtures, and database seeding.

1|Updated Mar 6, 2026
One-click install
npx skills add https://github.com/chavangorakh1999/sde-skills --skill test-data-chavangorakh1999
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-data
Source: https://github.com/chavangorakh1999/sde-skills/tree/main/sde-testing/skills/test-data
Command: npx skills add https://github.com/chavangorakh1999/sde-skills --skill test-data-chavangorakh1999

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @faker-js/faker, bcrypt, mongoose, and includes scripts (resource) and references (resource) components.

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.

Frequently Asked Questions about test-data

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate realistic test data using Faker.js?

You can generate realistic test data by using dynamic factory functions powered by Faker.js. This approach creates varied mock data entries for your tests, ensuring your application handles different data states correctly without hardcoding values.

What is the best way to prevent flaky tests caused by data dependencies?

The best way to prevent flaky tests caused by data dependencies is to implement test isolation strategies. Utilizing patterns like afterEach cleanup and database transactions ensures tests do not interfere with each other across different runs.

How do I use fixture files for stable test data?

You use fixture files by loading static JSON reference data that remains unchanged between test runs. This provides a stable, consistent baseline for evaluating application behavior without relying on dynamically generated mock values.

Does database seeding work for staging environments?

Yes, database seeding works for both development and staging environments. It populates your databases with realistic mock data, allowing you to test various scenarios against representative data states before deploying to production.

Can I use Mongoose with factory functions for database seeding?

Yes, you can use Mongoose with factory functions for database seeding. The test data generation process supports Mongoose as a dependency to populate your development databases with realistic, dynamically created documents.