Skip to content

Commit f3f02db

Browse files
committed
fix: update repo API test
1 parent 1e60ef5 commit f3f02db

File tree

1 file changed

+32
-6
lines changed

1 file changed

+32
-6
lines changed

test/testRepoApi.test.js

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,23 @@ const TEST_REPO = {
1616
name: 'test-repo',
1717
project: 'finos',
1818
host: 'github.com',
19+
protocol: 'https://',
1920
};
2021

2122
const TEST_REPO_NON_GITHUB = {
2223
url: 'https://gitlab.com/org/sub-org/test-repo2.git',
2324
name: 'test-repo2',
2425
project: 'org/sub-org',
2526
host: 'gitlab.com',
27+
protocol: 'https://',
2628
};
2729

2830
const TEST_REPO_NAKED = {
2931
url: 'https://123.456.789:80/test-repo3.git',
3032
name: 'test-repo3',
3133
project: '',
3234
host: '123.456.789:80',
35+
protocol: 'https://',
3336
};
3437

3538
const cleanupRepo = async (url) => {
@@ -263,7 +266,12 @@ describe('add new repo', async () => {
263266

264267
it('Proxy route helpers should return the proxied origin', async function () {
265268
const origins = await getAllProxiedHosts();
266-
expect(origins).to.eql([TEST_REPO.host]);
269+
expect(origins).to.eql([
270+
{
271+
host: TEST_REPO.host,
272+
protocol: TEST_REPO.protocol,
273+
},
274+
]);
267275
});
268276

269277
it('Proxy route helpers should return the new proxied origins when new repos are added', async function () {
@@ -285,7 +293,16 @@ describe('add new repo', async () => {
285293
repo.users.canAuthorise.length.should.equal(0);
286294

287295
const origins = await getAllProxiedHosts();
288-
expect(origins).to.have.members([TEST_REPO.host, TEST_REPO_NON_GITHUB.host]);
296+
expect(origins).to.have.deep.members([
297+
{
298+
host: TEST_REPO.host,
299+
protocol: TEST_REPO.protocol,
300+
},
301+
{
302+
host: TEST_REPO_NON_GITHUB.host,
303+
protocol: TEST_REPO_NON_GITHUB.protocol,
304+
},
305+
]);
289306

290307
const res2 = await chai
291308
.request(app)
@@ -297,10 +314,19 @@ describe('add new repo', async () => {
297314
repoIds[2] = repo2._id;
298315

299316
const origins2 = await getAllProxiedHosts();
300-
expect(origins2).to.have.members([
301-
TEST_REPO.host,
302-
TEST_REPO_NON_GITHUB.host,
303-
TEST_REPO_NAKED.host,
317+
expect(origins2).to.have.deep.members([
318+
{
319+
host: TEST_REPO.host,
320+
protocol: TEST_REPO.protocol,
321+
},
322+
{
323+
host: TEST_REPO_NON_GITHUB.host,
324+
protocol: TEST_REPO_NON_GITHUB.protocol,
325+
},
326+
{
327+
host: TEST_REPO_NAKED.host,
328+
protocol: TEST_REPO_NAKED.protocol,
329+
},
304330
]);
305331
});
306332

0 commit comments

Comments
 (0)