Skip to content

Commit

Permalink
fixup! feat(client-http): add ability to send sdk version
Browse files Browse the repository at this point in the history
  • Loading branch information
Billlynch committed Nov 16, 2023
1 parent 33f12a0 commit 95ff561
Showing 1 changed file with 19 additions and 16 deletions.
35 changes: 19 additions & 16 deletions packages/client-http/src/client/ConfidenceClient.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ describe('ConfidenceClient', () => {
id: 'SDK_ID_JS_WEB_PROVIDER',
version: 'TESTING',
},
timeout: 10,
timeout: 10,
});

describe('resolve', () => {
Expand Down Expand Up @@ -68,11 +68,11 @@ describe('ConfidenceClient', () => {
clientSecret: 'test-secret',
evaluationContext: context,
apply: options.apply,
sdk: {
id: 'SDK_ID_JS_WEB_PROVIDER',
version: 'TESTING',
},
flags: options.flags,
sdk: {
id: 'SDK_ID_JS_WEB_PROVIDER',
version: 'TESTING',
},
flags: options.flags,
}),
}),
);
Expand All @@ -92,18 +92,21 @@ describe('ConfidenceClient', () => {

await instanceUnderTest.resolve(context);

expect(mockFetch).toHaveBeenCalledWith(`https://resolver.eu.confidence.dev/v1/flags:resolve`, expect.objectContaining({
expect(mockFetch).toHaveBeenCalledWith(
`https://resolver.eu.confidence.dev/v1/flags:resolve`,
expect.objectContaining({
method: 'POST',
body: JSON.stringify({
clientSecret: 'test-secret',
evaluationContext: context,
apply: true,
sdk: {
id: 'SDK_ID_JS_WEB_PROVIDER',
version: 'TESTING',
},
})
}));
clientSecret: 'test-secret',
evaluationContext: context,
apply: true,
sdk: {
id: 'SDK_ID_JS_WEB_PROVIDER',
version: 'TESTING',
},
}),
}),
);
});

it('should throw any errors', async () => {
Expand Down

0 comments on commit 95ff561

Please sign in to comment.