Dev
Mock Feature Flag Config Generator
Used by developers, writers, and creators worldwide.
The mock feature flag config generator produces realistic fake feature toggle configs for testing flag evaluation logic, CI/CD pipelines, and admin UIs without touching production data. Engineers integrating LaunchDarkly, Unleash, Flagsmith, or homegrown toggle systems need varied, believable configs to cover real-world edge cases — flags at 0% rollout in staging, 50% in canary, 100% in production. Hand-crafted fixtures rarely cover that range. This tool generates flags with enabled/disabled states, rollout percentages, per-environment overrides, and creation timestamps. Choose JSON, YAML, or ENV output and set the count to match your test scenario. Output is copy-paste ready for fixture files, seed scripts, and Storybook stories.
Loading usage…
Free forever — no account required
How to use
- Choose your options above
- Click Generate
- Copy your result
Detailed instructions
- Set the Number of Flags input to match how many flag objects your test scenario or UI requires.
- Select your Output Format — JSON for API mocking, YAML for Kubernetes configs, or ENV for serverless deployments.
- Click Generate to produce a complete, randomized feature flag configuration object.
- Copy the output and paste it into your fixture file, seed script, or test setup block.
- Regenerate as many times as needed to get different rollout percentages and flag states for broader test coverage.
Use Cases
- •Seeding a feature flag admin dashboard with 8+ realistic sample flags for UI development
- •Generating JSON fixture files for Jest unit tests covering partial rollout edge cases
- •Mocking LaunchDarkly or Unleash configs inside Cypress integration test suites
- •Populating a local Flagsmith or Flipt instance with varied flag states during dev setup
- •Creating YAML fixtures for Kubernetes feature flag ConfigMap and Helm chart testing
Tips
- →Generate the same flag count twice and diff the outputs to build test cases that verify your system handles config changes correctly.
- →For ENV format output, pipe it directly into a `.env.test` file — most test runners load this automatically without extra setup.
- →When testing partial rollout logic, look for flags with 1-99% rollout values in the output; these are the edge cases most evaluation bugs hide in.
- →Combine JSON output with a schema validator like Ajv or Zod in your test suite to confirm your flag parser handles every generated shape without errors.
- →Generate 20+ flags when building a flag management UI — you need enough data to trigger pagination, overflow states, and search filtering realistically.
- →For LaunchDarkly SDK mock testing, use the JSON output as the response body in an MSW or nock interceptor to simulate the flag evaluation API.
FAQ
how do I generate mock feature flag configs for unit tests in javascript
Set the flag count to match your test scenario, pick JSON, and click Generate. Paste the output directly into a Jest fixture file or your test setup block. For table-driven tests, generate a larger batch and slice out the specific enabled, disabled, and partial-rollout states you need.
can I use generated flag configs to mock LaunchDarkly or Unleash in integration tests
Yes. The generated structure includes flag key, enabled state, rollout percentage, and per-environment overrides — the core fields both platforms evaluate. You may need to rename a field or two to match your SDK's exact schema, but the structure transfers cleanly with minimal adjustment.
are rollout percentages in the output random or do they follow a pattern
Percentages are randomized to reflect realistic distribution — expect a mix of 0%, 100%, and partial values like 25% or 50%. Real flag configs rarely have uniform values, so your evaluation logic should handle the full range. Edit specific values manually before committing them to fixtures.