Skip to content

Commit

Permalink
fix: format tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Noa-Savransky committed Sep 11, 2023
1 parent a00b52f commit 3974598
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions tests/httpUtils.spec.ts
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
import { getURL } from "../src/utils/httpUtils";
import { getURL } from '../src/utils/httpUtils';

describe('getURL', () => {
it('should return base + path if not fedramp', () => {
const base = 'api.dev.snyk.io';
const path = '/analysis';
it('should return base + path if not fedramp', () => {
const base = 'api.dev.snyk.io';
const path = '/analysis';

const result = getURL(base, path);
const result = getURL(base, path);

expect(result).toEqual(base+path);
});
expect(result).toEqual(base + path);
});

it('should return base + org routing + path if fedramp', () => {
const base = 'api.snykgov.io';
const path = '/analysis';
const orgId = '1-2-3-4'
it('should return base + org routing + path if fedramp', () => {
const base = 'api.snykgov.io';
const path = '/analysis';
const orgId = '1-2-3-4';

const result = getURL(base, path, orgId);
const result = getURL(base, path, orgId);

expect(result).toEqual(base+'/hidden/orgs/'+orgId+'/code'+path);
});
expect(result).toEqual(base + '/hidden/orgs/' + orgId + '/code' + path);
});

it('should throw an error if fedramp and org is missing', () => {
const base = 'api.snykgov.io';
const path = '/analysis';
it('should throw an error if fedramp and org is missing', () => {
const base = 'api.snykgov.io';
const path = '/analysis';

try {
const result = getURL(base, path);
} catch (err) {
expect(err).toBeDefined();
}
});
});
try {
const result = getURL(base, path);
} catch (err) {
expect(err).toBeDefined();
}
});
});

0 comments on commit 3974598

Please sign in to comment.