@@ -4,7 +4,7 @@ import { SentryError } from '../../src/error';
44import { TestBackend } from '../mocks/backend' ;
55import { TestClient } from '../mocks/client' ;
66
7- const PUBLIC_Dsn = 'https://username@domain/path' ;
7+ const PUBLIC_DSN = 'https://username@domain/path' ;
88
99jest . mock ( '@sentry/utils/misc' , ( ) => ( {
1010 uuid4 ( ) : string {
@@ -24,8 +24,8 @@ jest.mock('@sentry/utils/string', () => ({
2424describe ( 'BaseClient' , ( ) => {
2525 describe ( 'constructor() / getDsn()' , ( ) => {
2626 test ( 'returns the Dsn' , ( ) => {
27- const client = new TestClient ( { dsn : PUBLIC_Dsn } ) ;
28- expect ( client . getDsn ( ) ! . toString ( ) ) . toBe ( PUBLIC_Dsn ) ;
27+ const client = new TestClient ( { dsn : PUBLIC_DSN } ) ;
28+ expect ( client . getDsn ( ) ! . toString ( ) ) . toBe ( PUBLIC_DSN ) ;
2929 } ) ;
3030
3131 test ( 'allows missing Dsn' , ( ) => {
@@ -40,13 +40,13 @@ describe('BaseClient', () => {
4040
4141 describe ( 'install()' , ( ) => {
4242 test ( 'calls install() on Backend' , async ( ) => {
43- const client = new TestClient ( { dsn : PUBLIC_Dsn } ) ;
43+ const client = new TestClient ( { dsn : PUBLIC_DSN } ) ;
4444 client . install ( ) ;
4545 expect ( TestBackend . instance ! . installed ) . toBe ( 1 ) ;
4646 } ) ;
4747
4848 test ( 'calls install() only once' , async ( ) => {
49- const client = new TestClient ( { dsn : PUBLIC_Dsn } ) ;
49+ const client = new TestClient ( { dsn : PUBLIC_DSN } ) ;
5050 client . install ( ) ;
5151 client . install ( ) ;
5252 expect ( TestBackend . instance ! . installed ) . toBe ( 1 ) ;
@@ -59,7 +59,7 @@ describe('BaseClient', () => {
5959 } ) ;
6060
6161 test ( 'does not install() when disabled' , async ( ) => {
62- const client = new TestClient ( { enabled : false , dsn : PUBLIC_Dsn } ) ;
62+ const client = new TestClient ( { enabled : false , dsn : PUBLIC_DSN } ) ;
6363 client . install ( ) ;
6464 expect ( TestBackend . instance ! . installed ) . toBe ( 0 ) ;
6565 } ) ;
@@ -73,7 +73,7 @@ describe('BaseClient', () => {
7373
7474 describe ( 'getOptions()' , ( ) => {
7575 test ( 'returns the options' , ( ) => {
76- const options = { dsn : PUBLIC_Dsn , test : true } ;
76+ const options = { dsn : PUBLIC_DSN , test : true } ;
7777 const client = new TestClient ( options ) ;
7878 expect ( client . getOptions ( ) ) . toEqual ( options ) ;
7979 } ) ;
@@ -142,7 +142,7 @@ describe('BaseClient', () => {
142142
143143 describe ( 'captures' , ( ) => {
144144 test ( 'captures and sends exceptions' , async ( ) => {
145- const client = new TestClient ( { dsn : PUBLIC_Dsn } ) ;
145+ const client = new TestClient ( { dsn : PUBLIC_DSN } ) ;
146146 const scope = new Scope ( ) ;
147147 await client . captureException ( new Error ( 'test exception' ) , undefined , scope ) ;
148148 expect ( TestBackend . instance ! . event ) . toEqual ( {
@@ -160,7 +160,7 @@ describe('BaseClient', () => {
160160 } ) ;
161161
162162 test ( 'captures and sends messages' , async ( ) => {
163- const client = new TestClient ( { dsn : PUBLIC_Dsn } ) ;
163+ const client = new TestClient ( { dsn : PUBLIC_DSN } ) ;
164164 const scope = new Scope ( ) ;
165165 await client . captureMessage ( 'test message' , undefined , undefined , scope ) ;
166166 expect ( TestBackend . instance ! . event ) . toEqual ( {
@@ -172,7 +172,7 @@ describe('BaseClient', () => {
172172
173173 describe ( 'captureEvent() / prepareEvent()' , ( ) => {
174174 test ( 'skips when disabled' , async ( ) => {
175- const client = new TestClient ( { enabled : false , dsn : PUBLIC_Dsn } ) ;
175+ const client = new TestClient ( { enabled : false , dsn : PUBLIC_DSN } ) ;
176176 const scope = new Scope ( ) ;
177177 await client . captureEvent ( { } , undefined , scope ) ;
178178 expect ( TestBackend . instance ! . event ) . toBeUndefined ( ) ;
@@ -186,7 +186,7 @@ describe('BaseClient', () => {
186186 } ) ;
187187
188188 test ( 'sends an event' , async ( ) => {
189- const client = new TestClient ( { dsn : PUBLIC_Dsn } ) ;
189+ const client = new TestClient ( { dsn : PUBLIC_DSN } ) ;
190190 const scope = new Scope ( ) ;
191191 await client . captureEvent ( { message : 'message' } , undefined , scope ) ;
192192 expect ( TestBackend . instance ! . event ! . message ) . toBe ( 'message' ) ;
@@ -198,7 +198,7 @@ describe('BaseClient', () => {
198198
199199 test ( 'adds the configured environment' , async ( ) => {
200200 const client = new TestClient ( {
201- dsn : PUBLIC_Dsn ,
201+ dsn : PUBLIC_DSN ,
202202 environment : 'env' ,
203203 } ) ;
204204 const scope = new Scope ( ) ;
@@ -212,7 +212,7 @@ describe('BaseClient', () => {
212212
213213 test ( 'adds the configured release' , async ( ) => {
214214 const client = new TestClient ( {
215- dsn : PUBLIC_Dsn ,
215+ dsn : PUBLIC_DSN ,
216216 release : 'v1.0.0' ,
217217 } ) ;
218218 const scope = new Scope ( ) ;
@@ -225,7 +225,7 @@ describe('BaseClient', () => {
225225 } ) ;
226226
227227 test ( 'adds breadcrumbs' , async ( ) => {
228- const client = new TestClient ( { dsn : PUBLIC_Dsn } ) ;
228+ const client = new TestClient ( { dsn : PUBLIC_DSN } ) ;
229229 const scope = new Scope ( ) ;
230230 scope . addBreadcrumb ( { message : 'breadcrumb' } , 100 ) ;
231231 await client . captureEvent ( { message : 'message' } , undefined , scope ) ;
@@ -237,7 +237,7 @@ describe('BaseClient', () => {
237237 } ) ;
238238
239239 test ( 'limits previously saved breadcrumbs' , async ( ) => {
240- const client = new TestClient ( { dsn : PUBLIC_Dsn , maxBreadcrumbs : 1 } ) ;
240+ const client = new TestClient ( { dsn : PUBLIC_DSN , maxBreadcrumbs : 1 } ) ;
241241 const scope = new Scope ( ) ;
242242 scope . addBreadcrumb ( { message : '1' } , 100 ) ;
243243 scope . addBreadcrumb ( { message : '2' } , 200 ) ;
@@ -250,7 +250,7 @@ describe('BaseClient', () => {
250250 } ) ;
251251
252252 test ( 'adds context data' , async ( ) => {
253- const client = new TestClient ( { dsn : PUBLIC_Dsn } ) ;
253+ const client = new TestClient ( { dsn : PUBLIC_DSN } ) ;
254254 const scope = new Scope ( ) ;
255255 scope . setExtra ( 'b' , 'b' ) ;
256256 scope . setTag ( 'a' , 'a' ) ;
@@ -266,7 +266,7 @@ describe('BaseClient', () => {
266266 } ) ;
267267
268268 test ( 'adds fingerprint' , async ( ) => {
269- const client = new TestClient ( { dsn : PUBLIC_Dsn } ) ;
269+ const client = new TestClient ( { dsn : PUBLIC_DSN } ) ;
270270 const scope = new Scope ( ) ;
271271 scope . setFingerprint ( [ 'abcd' ] ) ;
272272 await client . captureEvent ( { message : 'message' } , undefined , scope ) ;
@@ -279,22 +279,22 @@ describe('BaseClient', () => {
279279
280280 test ( 'calls beforeSend and discards the event' , async ( ) => {
281281 const beforeSend = jest . fn ( ( ) => null ) ;
282- const client = new TestClient ( { dsn : PUBLIC_Dsn , beforeSend } ) ;
282+ const client = new TestClient ( { dsn : PUBLIC_DSN , beforeSend } ) ;
283283 const scope = new Scope ( ) ;
284284 await client . captureEvent ( { message : 'hello' } , undefined , scope ) ;
285285 expect ( TestBackend . instance ! . event ) . toBeUndefined ( ) ;
286286 } ) ;
287287
288288 test ( 'calls beforeSend and uses the new one' , async ( ) => {
289289 const beforeSend = jest . fn ( ( ) => ( { message : 'changed' } ) ) ;
290- const client = new TestClient ( { dsn : PUBLIC_Dsn , beforeSend } ) ;
290+ const client = new TestClient ( { dsn : PUBLIC_DSN , beforeSend } ) ;
291291 const scope = new Scope ( ) ;
292292 await client . captureEvent ( { message : 'hello' } , undefined , scope ) ;
293293 expect ( TestBackend . instance ! . event ! . message ) . toBe ( 'changed' ) ;
294294 } ) ;
295295
296296 it ( "doesn't do anything with rate limits yet" , async ( ) => {
297- const client = new TestClient ( { dsn : PUBLIC_Dsn } ) ;
297+ const client = new TestClient ( { dsn : PUBLIC_DSN } ) ;
298298 TestBackend . instance ! . sendEvent = async ( ) => ( { status : Status . RateLimit } ) ;
299299 const scope = new Scope ( ) ;
300300 await client . captureEvent ( { } , undefined , scope ) ;
0 commit comments