Backstage
    Preparing search index...

    Mock implementation of @backstage/frontend-plugin-api#FeatureFlagsApi for testing feature flag behavior.

    const api = new MockFeatureFlagsApi({
    initialStates: { 'my-feature': FeatureFlagState.Active }
    });
    expect(api.isActive('my-feature')).toBe(true);
    interface MockFeatureFlagsApi {
        clearState(): void;
        getRegisteredFlags(): FeatureFlag[];
        getState(): Record<string, FeatureFlagState>;
        isActive(name: string): boolean;
        registerFlag(flag: FeatureFlag): void;
        save(options: FeatureFlagsSaveOptions): void;
        setState(states: Record<string, FeatureFlagState>): void;
    }

    Implements

    Index

    Methods