|
1 | | -/* eslint-disable deprecation/deprecation */ |
2 | 1 | import { makeDsn } from '@sentry/utils'; |
3 | 2 |
|
4 | | -import { getEnvelopeEndpointWithUrlEncodedAuth, getReportDialogEndpoint, initAPIDetails } from '../../src/api'; |
| 3 | +import { getEnvelopeEndpointWithUrlEncodedAuth, getReportDialogEndpoint } from '../../src/api'; |
5 | 4 |
|
6 | 5 | const ingestDsn = 'https://[email protected]:1234/subpath/123'; |
7 | 6 | const dsnPublic = 'https://[email protected]:1234/subpath/123'; |
8 | 7 | const legacyDsn = 'https://abc:[email protected]:1234/subpath/123'; |
9 | 8 | const tunnel = 'https://hello.com/world'; |
10 | 9 |
|
11 | | -const ingestDsnAPI = initAPIDetails(ingestDsn); |
12 | | -const dsnPublicAPI = initAPIDetails(dsnPublic); |
| 10 | +const ingestDsnComponents = makeDsn(ingestDsn); |
| 11 | +const dsnPublicComponents = makeDsn(dsnPublic); |
13 | 12 |
|
14 | 13 | describe('API', () => { |
15 | 14 | test('getEnvelopeEndpoint', () => { |
16 | | - expect(getEnvelopeEndpointWithUrlEncodedAuth(dsnPublicAPI.dsn)).toEqual( |
| 15 | + expect(getEnvelopeEndpointWithUrlEncodedAuth(dsnPublicComponents)).toEqual( |
17 | 16 | 'https://sentry.io:1234/subpath/api/123/envelope/?sentry_key=abc&sentry_version=7', |
18 | 17 | ); |
19 | | - const dsnPublicAPIWithTunnel = initAPIDetails(dsnPublic, {}, tunnel); |
20 | | - expect(getEnvelopeEndpointWithUrlEncodedAuth(dsnPublicAPIWithTunnel.dsn, tunnel)).toEqual(tunnel); |
| 18 | + }); |
| 19 | + |
| 20 | + test('getEnvelopeEndpoint with tunnel', () => { |
| 21 | + expect(getEnvelopeEndpointWithUrlEncodedAuth(dsnPublicComponents, tunnel)).toEqual(tunnel); |
21 | 22 | }); |
22 | 23 |
|
23 | 24 | describe('getReportDialogEndpoint', () => { |
@@ -99,14 +100,4 @@ describe('API', () => { |
99 | 100 | }, |
100 | 101 | ); |
101 | 102 | }); |
102 | | - |
103 | | - test('initAPIDetails dsn', () => { |
104 | | - expect(dsnPublicAPI.dsn.host).toEqual(makeDsn(dsnPublic).host); |
105 | | - expect(dsnPublicAPI.dsn.path).toEqual(makeDsn(dsnPublic).path); |
106 | | - expect(dsnPublicAPI.dsn.pass).toEqual(makeDsn(dsnPublic).pass); |
107 | | - expect(dsnPublicAPI.dsn.port).toEqual(makeDsn(dsnPublic).port); |
108 | | - expect(dsnPublicAPI.dsn.protocol).toEqual(makeDsn(dsnPublic).protocol); |
109 | | - expect(dsnPublicAPI.dsn.projectId).toEqual(makeDsn(dsnPublic).projectId); |
110 | | - expect(dsnPublicAPI.dsn.publicKey).toEqual(makeDsn(dsnPublic).publicKey); |
111 | | - }); |
112 | 103 | }); |
0 commit comments