Published
Feature flag coverage
In brief: Feature flag coverage shows, for every user story, which feature flags matter to it and which values (arms) of each flag your tests actually ran. Untested arms show up before they reach users.
Feature flag coverage is the share of feature flag values that your tests have run. For each user story, TestChimp lists the flags its tests evaluate, every arm of each flag (for example true and false, or control and annual-first), and the tests that ran each arm. Arms that no test ran are listed as untested.
It needs two inputs:
- Your flag provider (LaunchDarkly, PostHog or Statsig) says which flags and arms exist.
- Your test runs say which arms actually ran. The
@testchimp/playwrightfixture records flag evaluations from the browser and from the backend that served the test's requests.
Why it matters
Most test suites run a feature with whatever flag values the test environment happens to serve. Usually that is one arm. The other arm ships untested, and nobody can see that from a green build. That gap shows up in:
- Dark launches and partial rollouts: the new code path is on for 10% of users and for none of your tests.
- Kill switches: the "off" arm is the one you need in an incident, and it is rarely tested.
- Experiment variants: each variant is a different page, and tests usually cover only the control.
- Flag debt: before removing a flag, you want to know the arm you keep is the one your tests run.
Feature flag coverage makes these gaps visible per story, so you or your coding agent can close them with tests.
What you see
In Insights → Feature flag coverage, each story shows:
- a count of arms tested out of the total, for example
3/4 arms; - each relevant flag, with its arms, the rollout percentage your provider reports for the test environment, and a status: Tested, Tested (forced), Untested or Ignored;
- the tests that ran each arm, and whether each arm was seen in the frontend, the backend, or set by the test itself.
For each untested arm you can copy an agent prompt that names the story, flag and arm, ignore the gap, or create an issue. You can also pin a flag to a story or exclude it. The release page shows the same view scoped to a release, as an informational panel. See How it works for the statuses and rules.
How it differs from requirement coverage
Requirement coverage tells you whether a story's scenarios have tests and whether they pass. Feature flag coverage uses the same story to scenario to test lineage and adds one more question: which flag values did those tests run? A story can be fully covered by requirements and still have an untested flag arm. See the Coverage overview for all coverage types.
Who it is for
- Teams that ship behind flags with LaunchDarkly, PostHog, Statsig or an OpenFeature provider.
- Release owners who want to know which flag arms a release has not tested before turning a flag up.
- Coding agents that close coverage gaps. The
get-feature-flag-coveragetool returns the untested arms per story, and/testchimp fix coverage gapscan work them.
Feature flag coverage is available on every plan, including free.
Get started
Paste this into your coding agent (the TestChimp skill must be installed):
Set up feature flag coverage with TestChimp for this repo.
Use the TestChimp skill: /testchimp setup feature flag coverage.
Detect which flag SDK the app uses (LaunchDarkly, PostHog, OpenFeature), instrument the frontend and, if the backend evaluates flags, the Node backend. Show me your plan before you change anything.
Do not put any provider credentials in chat. Tell me when I need to connect the provider in TestChimp settings.
Or follow the manual steps in Setup.
Next steps
FAQ
What is feature flag coverage?
The share of feature flag values your tests have run. For each user story, TestChimp lists the flags its tests evaluate, every arm of each flag, and which arms no test ran.
Is this code coverage for flag branches?
No. It records which flag values your app evaluated while each test ran. It does not instrument your code.
Do I need to connect a flag provider?
No, but it helps. Without a connection TestChimp shows only the arms your tests ran and marks the flag Catalog unknown. With a connection it also lists arms no test ran.
Does it change my production app?
No. The @testchimp/flags hooks do nothing unless the TestChimp fixture is present in the browser, or TESTCHIMP_FLAG_ECHO=1 is set on the backend. Set that variable in test environments only.
Which providers are supported?
Catalog sync supports LaunchDarkly, PostHog and Statsig. Evaluations from any OpenFeature provider are captured too.