Skip to content

Commit

Permalink
more lints
Browse files Browse the repository at this point in the history
  • Loading branch information
Fondryext committed Sep 10, 2024
1 parent 8e20d0b commit 1dbf685
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 33 deletions.
5 changes: 4 additions & 1 deletion src/provideEndpoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,8 @@ export class EndpointsFactory {
* @public
*/
export const SandboxEndpoints: Required<Endpoints> =
new EndpointsFactory({ environment: Environment.SANDBOX, cloudRegion: CloudRegion.US, cloudChoice: CloudChoice.GLOBAL_MULTI })
new EndpointsFactory({
environment: Environment.SANDBOX,
cloudRegion: CloudRegion.US,
cloudChoice: CloudChoice.GLOBAL_MULTI })
.getEndpoints();
64 changes: 32 additions & 32 deletions tests/provideEndpointsTest.ts
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
import {EndpointsFactory} from '../src/provideEndpoints';
import {CloudChoice, CloudRegion, Environment} from "../src";
import { EndpointsFactory } from '../src/provideEndpoints';
import { CloudChoice, CloudRegion, Environment } from '../src';

it('Sandbox, US, Multi produces expected endpoint', () => {
const endPoints = new EndpointsFactory({
environment: Environment.SANDBOX,
cloudRegion: CloudRegion.US,
cloudChoice: CloudChoice.GLOBAL_MULTI
}).getEndpoints();
expect(endPoints).toHaveProperty('universalSearch', 'https://sbx-cdn.us.yextapis.com/v2/accounts/me/search/query');
const endPoints = new EndpointsFactory({
environment: Environment.SANDBOX,
cloudRegion: CloudRegion.US,
cloudChoice: CloudChoice.GLOBAL_MULTI
}).getEndpoints();
expect(endPoints).toHaveProperty('universalSearch', 'https://sbx-cdn.us.yextapis.com/v2/accounts/me/search/query');
});

it('Prod, US, Multi produces expected endpoint', () => {
const endPoints = new EndpointsFactory({
environment: Environment.PROD,
cloudRegion: CloudRegion.US,
cloudChoice: CloudChoice.GLOBAL_MULTI
}).getEndpoints();
expect(endPoints).toHaveProperty('verticalSearch', 'https://prod-cdn.us.yextapis.com/v2/accounts/me/search/vertical/query');
const endPoints = new EndpointsFactory({
environment: Environment.PROD,
cloudRegion: CloudRegion.US,
cloudChoice: CloudChoice.GLOBAL_MULTI
}).getEndpoints();
expect(endPoints).toHaveProperty('verticalSearch', 'https://prod-cdn.us.yextapis.com/v2/accounts/me/search/vertical/query');
});

it('Prod, US, GCP produces expected endpoint', () => {
const endPoints = new EndpointsFactory({
environment: Environment.PROD,
cloudRegion: CloudRegion.US,
cloudChoice: CloudChoice.GLOBAL_GCP
}).getEndpoints();
expect(endPoints).toHaveProperty('universalAutocomplete', 'https://prod-cdn-gcp.us.yextapis.com/v2/accounts/me/search/autocomplete');
const endPoints = new EndpointsFactory({
environment: Environment.PROD,
cloudRegion: CloudRegion.US,
cloudChoice: CloudChoice.GLOBAL_GCP
}).getEndpoints();
expect(endPoints).toHaveProperty('universalAutocomplete', 'https://prod-cdn-gcp.us.yextapis.com/v2/accounts/me/search/autocomplete');
});

it('Prod, EU, Multi produces expected endpoint', () => {
const endPoints = new EndpointsFactory({
environment: Environment.PROD,
cloudRegion: CloudRegion.EU,
cloudChoice: CloudChoice.GLOBAL_MULTI
}).getEndpoints();
expect(endPoints).toHaveProperty('verticalAutocomplete', 'https://prod-cdn.eu.yextapis.com/v2/accounts/me/search/vertical/autocomplete');
const endPoints = new EndpointsFactory({
environment: Environment.PROD,
cloudRegion: CloudRegion.EU,
cloudChoice: CloudChoice.GLOBAL_MULTI
}).getEndpoints();
expect(endPoints).toHaveProperty('verticalAutocomplete', 'https://prod-cdn.eu.yextapis.com/v2/accounts/me/search/vertical/autocomplete');
});

it('Prod, EU, GCP produces expected endpoint', () => {
const endPoints = new EndpointsFactory({
environment: Environment.PROD,
cloudRegion: CloudRegion.EU,
cloudChoice: CloudChoice.GLOBAL_GCP
}).getEndpoints();
expect(endPoints).toHaveProperty('filterSearch', 'https://prod-cdn-gcp.eu.yextapis.com/v2/accounts/me/search/filtersearch');
const endPoints = new EndpointsFactory({
environment: Environment.PROD,
cloudRegion: CloudRegion.EU,
cloudChoice: CloudChoice.GLOBAL_GCP
}).getEndpoints();
expect(endPoints).toHaveProperty('filterSearch', 'https://prod-cdn-gcp.eu.yextapis.com/v2/accounts/me/search/filtersearch');
});

0 comments on commit 1dbf685

Please sign in to comment.