import type { Metadata } from '../../types'; import { getMFESupportsVersionedLDClient } from '../get-mfe-supports-versioned-ld-client'; describe(`[web-components] ${getMFESupportsVersionedLDClient.name}`, () => { let bundledWith: NonNullable; beforeEach(() => { bundledWith = {}; }); const subject = () => getMFESupportsVersionedLDClient(bundledWith); function itReturns(value: boolean) { test(`returns ${value}`, () => { expect(subject()).toBe(value); }); } itReturns(false); describe('when bundledWith @servicetitan/launchdarkly-service is below the threshold version', () => { beforeEach(() => (bundledWith['@servicetitan/launchdarkly-service'] = '39.5.0')); itReturns(false); }); describe('when bundledWith @servicetitan/launchdarkly-service meets the threshold version', () => { beforeEach(() => (bundledWith['@servicetitan/launchdarkly-service'] = '40.0.0')); itReturns(true); }); describe('when bundledWith @servicetitan/launchdarkly-service exceeds the threshold version', () => { beforeEach(() => (bundledWith['@servicetitan/launchdarkly-service'] = '41.0.0')); itReturns(true); }); });