0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-21 21:49:51 +01:00
posthog/cypress
2024-11-19 02:17:43 +01:00
..
data/exports
e2e
fixtures
productAnalytics
support
README.md
tsconfig.json
wait.py

Testing Feature Flags

The Cypress tests run with a PostHog instance that has no feature flags set up.

To test feature flags you can intercept the call to the decide endpoint

// sometimes the system under test calls `/decide`
// and sometimes it calls https://app.posthog.com/decide
cy.intercept('**/decide/*', (req) =>
    req.reply(
        decideResponse({
            // add feature flags here, for e.g.
            // 'feature-flag-key': true,
        })
    )
)