Mock Feature Flag Config Generator
Generates realistic fake feature flag configuration objects for testing feature toggle systems
Generated 239 words · 2,801 characters
See 3 examples
- Example 1
{ "feature_flags": [ { "key": "allow_profile_avatar_upload", "enabled": true, "rollout_percentage": 100, "description": "Lets eligible accounts use avatar uploads in the user profile", "environments": { "production": true, "staging": true, "development": true }, "created_at": "2025-01-17" }, { "key": "use_auth_session_timeout_warning", "enabled": true, "rollout_percentage": 100, "description": "Uses the new implementation of session timeout warnings in the sign-in flow", "environments": { "production": true, "staging": false, "development": true }, "created_at": "2026-01-13" }, { "key": "launch_onboarding_video_intro", "enabled": false, "rollout_percentage": 0, "description": "Release toggle for the intro video in the onboarding flow", "environments": { "production": true, "staging": true, "development": true }, "created_at": "2024-06-23" }, { "key": "rollout_cart_cart_recommendations", "enabled": true, "rollout_percentage": 65, "description": "Percentage rollout of cart recommendations to the shopping cart", "environments": { "production": true, "staging": false, "development": true }, "created_at": "2024-12-30" }, { "key": "show_profile_profile_banner", "enabled": true, "rollout_percentage": 39, "description": "Shows profile banners in the user profile", "environments": { "production": true, "staging": true, "development": true }, "created_at": "2026-08-29" }, { "key": "enable_api_pagination_cursors", "enabled": false, "rollout_percentage": 0, "description": "Turns on cursor pagination for the public API", "environments": { "production": false, "staging": true, "development": true }, "created_at": "2026-05-22" }, { "key": "rollout_onboarding_invite_teammates_step", "enabled": false, "rollout_percentage": 0, "description": "Staged release of the invite-teammates step in the onboarding flow", "environments": { "production": false, "staging": true, "development": false }, "created_at": "2025-03-27" }, { "key": "rollout_navigation_breadcrumbs", "enabled": true, "rollout_percentage": 39, "description": "Percentage rollout of breadcrumbs to the site navigation", "environments": { "production": true, "staging": true, "development": true }, "created_at": "2026-10-17" } ] } - Example 2
{ "feature_flags": [ { "key": "disable_support_chatbot", "enabled": true, "rollout_percentage": 100, "description": "Turns off the support chatbot in the help center during incidents", "environments": { "production": false, "staging": true, "development": false }, "created_at": "2026-06-04" }, { "key": "hide_calendar_drag_to_reschedule", "enabled": true, "rollout_percentage": 10, "description": "Hides drag-to-reschedule from the calendar view while it is reworked", "environments": { "production": true, "staging": true, "development": true }, "created_at": "2026-03-13" }, { "key": "beta_mobile_biometric_unlock", "enabled": false, "rollout_percentage": 0, "description": "Early-access program for biometric unlock in the mobile app", "environments": { "production": true, "staging": true, "development": true }, "created_at": "2025-04-09" }, { "key": "show_admin_approval_queue", "enabled": true, "rollout_percentage": 100, "description": "Surfaces the approval queue in the admin console", "environments": { "production": false, "staging": true, "development": false }, "created_at": "2024-08-11" }, { "key": "hide_reports_cohort_charts", "enabled": false, "rollout_percentage": 0, "description": "Hides cohort charts from the reporting module while it is reworked", "environments": { "production": true, "staging": true, "development": true }, "created_at": "2024-03-29" }, { "key": "test_profile_avatar_upload", "enabled": false, "rollout_percentage": 0, "description": "A/B test of avatar uploads in the user profile", "environments": { "production": false, "staging": false, "development": true }, "created_at": "2024-07-20" }, { "key": "disable_support_live_chat", "enabled": true, "rollout_percentage": 29, "description": "Disables live chat in the help center without a deploy", "environments": { "production": true, "staging": true, "development": true }, "created_at": "2025-07-18" }, { "key": "rollout_editor_rich_text", "enabled": false, "rollout_percentage": 0, "description": "Percentage rollout of rich text formatting to the document editor", "environments": { "production": true, "staging": true, "development": true }, "created_at": "2026-08-25" } ] } - Example 3
{ "feature_flags": [ { "key": "enable_calendar_agenda_view", "enabled": false, "rollout_percentage": 0, "description": "Enables the agenda view in the calendar view", "environments": { "production": false, "staging": true, "development": true }, "created_at": "2024-04-08" }, { "key": "hide_billing_self_serve_cancel", "enabled": false, "rollout_percentage": 0, "description": "Temporarily hides self-serve cancellation in the billing settings", "environments": { "production": true, "staging": true, "development": true }, "created_at": "2026-07-20" }, { "key": "enable_settings_language_selector", "enabled": true, "rollout_percentage": 30, "description": "Activates the language selector across the settings page", "environments": { "production": false, "staging": true, "development": true }, "created_at": "2025-11-02" }, { "key": "test_dashboard_compact_layout", "enabled": true, "rollout_percentage": 6, "description": "Experiment comparing the compact layout against the current main dashboard", "environments": { "production": true, "staging": true, "development": false }, "created_at": "2025-12-04" }, { "key": "hide_editor_spell_check", "enabled": false, "rollout_percentage": 0, "description": "Removes spell checking from view in the document editor", "environments": { "production": false, "staging": false, "development": true }, "created_at": "2024-10-09" }, { "key": "use_payments_wallet_payments", "enabled": true, "rollout_percentage": 100, "description": "Routes the payment service through the new digital wallet payments service", "environments": { "production": false, "staging": true, "development": false }, "created_at": "2024-12-07" }, { "key": "beta_calendar_availability_sharing", "enabled": true, "rollout_percentage": 100, "description": "Opt-in beta of availability sharing in the calendar view", "environments": { "production": true, "staging": true, "development": false }, "created_at": "2026-03-21" }, { "key": "rollout_editor_slash_commands", "enabled": false, "rollout_percentage": 0, "description": "Gradual rollout of slash commands in the document editor", "environments": { "production": false, "staging": false, "development": true }, "created_at": "2026-07-26" } ] }
About this generator
Feature flag systems — LaunchDarkly, Unleash, Flagsmith, and homegrown toggles — evaluate configs with flag keys, enabled states, rollout percentages, and per-environment overrides. Testing the logic that reads those configs requires fixture data with real variation: some flags at 0% in production, others at 100% in staging, a few partial canaries. This generator produces realistic flag configs with all those fields. Set count (2–25) to match your scenario. Choose format: JSON for API mocking and Jest fixtures, YAML for Kubernetes ConfigMaps and Helm values, or ENV for serverless deployments. JSON output includes feature_flags array with key, enabled, rollout_percentage, description, environment overrides, and created_at. For edge-case coverage, look for rollout_percentage values between 1 and 99 — partial rollouts are where most evaluation bugs hide.
How to use
- 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 enabled, disabled, and partial-rollout states you need.
can I use generated flag configs to mock LaunchDarkly or Unleash in integration tests
Yes. The JSON output 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 with minimal adjustment.
are rollout percentages in the output random or do they follow a pattern
Percentages are randomized independently per flag. When a flag is enabled (about 60% of generated flags), roughly half are fully rolled out at 100 and the rest get a partial rollout, a random integer from 1 to 99. When a flag is disabled, rollout_percentage is set to 0. This gives you a realistic mix of 0%, 100%, and intermediate values.
what fields does each generated feature flag object include
Each JSON flag object includes: key (snake_case combining a prefix like enable_, rollout_ or test_ with a product area and feature name, such as enable_checkout_guest_checkout), enabled (boolean), rollout_percentage (integer 0–100), description, an environments object with production/staging/development boolean overrides, and created_at (a date string). YAML and ENV formats include a subset of these fields.
You might also like
Popular tools from other categories that share themes with this one.