Skip to content

Commit e794a2e

Browse files
committed
Fixing endpoint test
1 parent 1fb0347 commit e794a2e

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

components/pryv/test/Connection.test.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22
* @license
33
* [BSD-3-Clause](https://github.com/pryv/lib-js/blob/master/LICENSE)
44
*/
5-
/* global describe, it, xit, before, after, beforeEach, afterEach, expect, Browser, pryv, testData, Blob, FormData */
5+
/* global describe, it, xit, before, after, beforeEach, afterEach, expect, Browser, pryv, Blob, FormData */
66
/* eslint-disable no-unused-expressions */
77

88
const { URL, URLSearchParams } = require('universal-url');
99
const cuid = require('cuid');
10+
const testData = require('../../../test/test-data');
1011

1112
let conn = null;
1213

@@ -302,8 +303,10 @@ describe('Connection', () => {
302303

303304
describe('API', () => {
304305
it('endpoint property', async () => {
306+
const [protocol, hostPath] = testData.serviceInfo.api.split('://');
307+
const challenge = protocol + '://' + conn.token + '@' + hostPath.replace('{username}', testData.username);
305308
const apiEndpoint = conn.apiEndpoint;
306-
expect(apiEndpoint.startsWith('https://' + conn.token + '@')).to.be.true;
309+
expect(apiEndpoint).to.equal(challenge);
307310
});
308311
});
309312

0 commit comments

Comments
 (0)