Skip to content

Commit

Permalink
Fix client configuration and tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
kinyoklion committed Oct 10, 2024
1 parent 511c58a commit 30fe70c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ describe('EventSource', () => {
jest.runAllTimers();
// This forces it to reconnect.
// @ts-ignore
eventSource.tryConnect();
eventSource._tryConnect();
jest.runAllTimers();

expect(logger.debug).toHaveBeenNthCalledWith(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ describe('sdk-client object', () => {
expect.objectContaining<InputIdentifyEvent>({
kind: 'identify',
context: expect.objectContaining({
contexts: expect.objectContaining({
_contexts: expect.objectContaining({
car: { key: 'test-car' },
}),
}),
Expand All @@ -130,7 +130,7 @@ describe('sdk-client object', () => {
kind: 'custom',
key: 'the-event',
context: expect.objectContaining({
contexts: expect.objectContaining({
_contexts: expect.objectContaining({
car: { key: 'test-car' },
}),
}),
Expand All @@ -153,7 +153,7 @@ describe('sdk-client object', () => {
kind: 'custom',
key: 'the-event',
context: expect.objectContaining({
contexts: expect.objectContaining({
_contexts: expect.objectContaining({
car: { key: 'test-car' },
}),
}),
Expand All @@ -176,7 +176,7 @@ describe('sdk-client object', () => {
kind: 'custom',
key: 'the-event',
context: expect.objectContaining({
contexts: expect.objectContaining({
_contexts: expect.objectContaining({
car: { key: 'test-car' },
}),
}),
Expand Down
17 changes: 11 additions & 6 deletions packages/shared/sdk-client/src/configuration/Configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,14 @@ function ensureSafeLogger(logger?: LDLogger): LDLogger {
export default class ConfigurationImpl implements Configuration {
public readonly logger: LDLogger = createSafeLogger();

private readonly _baseUri = DEFAULT_POLLING;
private readonly _eventsUri = ServiceEndpoints.DEFAULT_EVENTS;
private readonly _streamUri = DEFAULT_STREAM;
// Naming conventions is not followed for these lines because the config validation
// accesses members based on the keys of the options.

Check failure on line 75 in packages/shared/sdk-client/src/configuration/Configuration.ts

View workflow job for this annotation

GitHub Actions / build-test-sdk-client

Delete `·`
// eslint-disable-next-line @typescript-eslint/naming-convention
private readonly baseUri = DEFAULT_POLLING;
// eslint-disable-next-line @typescript-eslint/naming-convention
private readonly eventsUri = ServiceEndpoints.DEFAULT_EVENTS;
// eslint-disable-next-line @typescript-eslint/naming-convention
private readonly streamUri = DEFAULT_STREAM;

public readonly maxCachedContexts = 5;

Expand Down Expand Up @@ -130,9 +135,9 @@ export default class ConfigurationImpl implements Configuration {
errors.forEach((e: string) => this.logger.warn(e));

this.serviceEndpoints = new ServiceEndpoints(
this._streamUri,
this._baseUri,
this._eventsUri,
this.streamUri,
this.baseUri,
this.eventsUri,
internalOptions.analyticsEventPath,
internalOptions.diagnosticEventPath,
internalOptions.includeAuthorizationHeader,
Expand Down

0 comments on commit 30fe70c

Please sign in to comment.