|
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://abc@xxxx.ingest.sentry.io:1234/subpath/123'; |
7 | 6 | const dsnPublic = 'https://abc@sentry.io:1234/subpath/123'; |
8 | 7 | const tunnel = 'https://hello.com/world'; |
9 | 8 |
|
10 | | -const dsnPublicAPI = initAPIDetails(dsnPublic); |
| 9 | +const dsnPublicComponents = makeDsn(dsnPublic); |
11 | 10 |
|
12 | 11 | describe('API', () => { |
13 | 12 | test('getEnvelopeEndpoint', () => { |
14 | | - expect(getEnvelopeEndpointWithUrlEncodedAuth(dsnPublicAPI.dsn)).toEqual( |
| 13 | + expect(getEnvelopeEndpointWithUrlEncodedAuth(dsnPublicComponents)).toEqual( |
15 | 14 | 'https://sentry.io:1234/subpath/api/123/envelope/?sentry_key=abc&sentry_version=7', |
16 | 15 | ); |
17 | | - const dsnPublicAPIWithTunnel = initAPIDetails(dsnPublic, {}, tunnel); |
18 | | - expect(getEnvelopeEndpointWithUrlEncodedAuth(dsnPublicAPIWithTunnel.dsn, tunnel)).toEqual(tunnel); |
| 16 | + }); |
| 17 | + |
| 18 | + test('getEnvelopeEndpoint with tunnel', () => { |
| 19 | + expect(getEnvelopeEndpointWithUrlEncodedAuth(dsnPublicComponents, tunnel)).toEqual(tunnel); |
19 | 20 | }); |
20 | 21 |
|
21 | 22 | describe('getReportDialogEndpoint', () => { |
@@ -97,14 +98,4 @@ describe('API', () => { |
97 | 98 | }, |
98 | 99 | ); |
99 | 100 | }); |
100 | | - |
101 | | - test('initAPIDetails dsn', () => { |
102 | | - expect(dsnPublicAPI.dsn.host).toEqual(makeDsn(dsnPublic).host); |
103 | | - expect(dsnPublicAPI.dsn.path).toEqual(makeDsn(dsnPublic).path); |
104 | | - expect(dsnPublicAPI.dsn.pass).toEqual(makeDsn(dsnPublic).pass); |
105 | | - expect(dsnPublicAPI.dsn.port).toEqual(makeDsn(dsnPublic).port); |
106 | | - expect(dsnPublicAPI.dsn.protocol).toEqual(makeDsn(dsnPublic).protocol); |
107 | | - expect(dsnPublicAPI.dsn.projectId).toEqual(makeDsn(dsnPublic).projectId); |
108 | | - expect(dsnPublicAPI.dsn.publicKey).toEqual(makeDsn(dsnPublic).publicKey); |
109 | | - }); |
110 | 101 | }); |
0 commit comments