Skip to content

Commit

Permalink
fix linter issues
Browse files Browse the repository at this point in the history
  • Loading branch information
keelerm84 committed Aug 26, 2024
1 parent bbb46cd commit 82b27b6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
14 changes: 12 additions & 2 deletions packages/shared/common/__tests__/options/ServiceEndpoints.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,19 @@ describe.each([
});

it('applies payload filter to polling and streaming endpoints', () => {
const endpoints = new ServiceEndpoints('https://stream.launchdarkly.com', 'https://sdk.launchdarkly.com', 'https://events.launchdarkly.com', '/bulk', '/diagnostic', true, 'filterKey');
const endpoints = new ServiceEndpoints(
'https://stream.launchdarkly.com',
'https://sdk.launchdarkly.com',
'https://events.launchdarkly.com',
'/bulk',
'/diagnostic',
true,
'filterKey',
);

expect(endpoints.getStreamingUri('')).toEqual('https://stream.launchdarkly.com/?filter=filterKey');
expect(endpoints.getStreamingUri('')).toEqual(
'https://stream.launchdarkly.com/?filter=filterKey',
);
expect(endpoints.getPollingUri('')).toEqual('https://sdk.launchdarkly.com/?filter=filterKey');
expect(endpoints.events).toEqual('https://events.launchdarkly.com');
});
10 changes: 5 additions & 5 deletions packages/shared/common/src/options/ServiceEndpoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ export default class ServiceEndpoints {
}

/**
* Constructs and returns the URI to be used for a streaming connection.
*/
* Constructs and returns the URI to be used for a streaming connection.
*/
public getStreamingUri(path: string): string {
return this.getFilteredUri(`${this.streaming}${path}`);
}

/**
* Constructs and returns the URI to be used for a polling connection.
*/
* Constructs and returns the URI to be used for a polling connection.
*/
public getPollingUri(path: string): string {
return this.getFilteredUri(`${this.polling}${path}`);
}
Expand All @@ -75,7 +75,7 @@ export default class ServiceEndpoints {
}

try {
let url = new URL(uri);
const url = new URL(uri);
url.searchParams.set('filter', this.payloadFilterKey);
return url.toString();
} catch (e) {
Expand Down

0 comments on commit 82b27b6

Please sign in to comment.