Skip to content

Commit cf35803

Browse files
committed
Fix tests for LaunchDarkly provider.
Signed-off-by: Ryan Lamb <[email protected]>
1 parent 96dd7ee commit cf35803

File tree

1 file changed

+24
-3
lines changed

1 file changed

+24
-3
lines changed

libs/providers/launchdarkly-client/src/lib/launchdarkly-client-provider.spec.ts

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,12 @@ describe('LaunchDarklyClientProvider', () => {
6868

6969
const provider = new LaunchDarklyClientProvider(envKey, { logger, ...ldOptionsMock });
7070

71-
expect(provider['ldOptions']).toStrictEqual({ ...ldOptionsMock, logger });
71+
expect(provider['ldOptions']).toStrictEqual({
72+
...ldOptionsMock,
73+
logger,
74+
wrapperName: 'open-feature-community-js-client',
75+
wrapperVersion: expect.any(String),
76+
});
7277
});
7378
});
7479

@@ -81,7 +86,15 @@ describe('LaunchDarklyClientProvider', () => {
8186
await provider.initialize();
8287
expect(initialize).toHaveBeenCalledTimes(1);
8388
/* when not set in open feauture LD sdk initialize should be called with the anonymous context*/
84-
expect(initialize).toHaveBeenCalledWith(envKey, { anonymous: true }, { logger });
89+
expect(initialize).toHaveBeenCalledWith(
90+
envKey,
91+
{ anonymous: true },
92+
{
93+
logger,
94+
wrapperName: 'open-feature-community-js-client',
95+
wrapperVersion: expect.any(String),
96+
},
97+
);
8598
expect(ldClientMock.waitForInitialization).toHaveBeenCalledWith(undefined);
8699
});
87100

@@ -90,7 +103,15 @@ describe('LaunchDarklyClientProvider', () => {
90103
await provider.initialize();
91104
expect(initialize).toHaveBeenCalledTimes(1);
92105
/* when not set in open feauture LD sdk initialize should be called with the anonymous context*/
93-
expect(initialize).toHaveBeenCalledWith(envKey, { anonymous: true }, { logger });
106+
expect(initialize).toHaveBeenCalledWith(
107+
envKey,
108+
{ anonymous: true },
109+
{
110+
logger,
111+
wrapperName: 'open-feature-community-js-client',
112+
wrapperVersion: expect.any(String),
113+
},
114+
);
94115
expect(ldClientMock.waitForInitialization).toHaveBeenCalledTimes(1);
95116
expect(ldClientMock.waitForInitialization).toHaveBeenCalledWith(5);
96117
});

0 commit comments

Comments
 (0)