-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ref(types): deprecate span status enum (#4299)
* ref(span): deprecate span status enum * ts(span): widen type * ref(span): avoid reexporting the enum * ref(types): fix all imports * fix(test): remove extra space * fix(test): import extension methods * ref(types): deprecate transactionmethod enum (#4314) * ref(types): deprecate transactionmethod enum * fix(types): drop transactionsamplingmethod * ref(types): deprecate outcome enum (#4315) * ref(types): deprecate outcome enum * fix(types): drop transportoutcome * ref(types): deprecate request status enum (#4316) * ref(types): deprecate request status * ref(types): deprecate session status * ref(types): remove unused logLevel (#4317) (#4320)
- Loading branch information
Showing
45 changed files
with
298 additions
and
299 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
import { Outcome } from '@sentry/types'; | ||
|
||
import { BaseTransport } from '../../../src/transports/base'; | ||
|
||
const testDsn = 'https://[email protected]/42'; | ||
|
@@ -44,12 +42,12 @@ describe('BaseTransport', () => { | |
it('sends beacon request when there are outcomes captured and visibility changed to `hidden`', () => { | ||
const transport = new SimpleTransport({ dsn: testDsn, sendClientReports: true }); | ||
|
||
transport.recordLostEvent(Outcome.BeforeSend, 'event'); | ||
transport.recordLostEvent('before_send', 'event'); | ||
|
||
visibilityState = 'hidden'; | ||
document.dispatchEvent(new Event('visibilitychange')); | ||
|
||
const outcomes = [{ reason: Outcome.BeforeSend, category: 'error', quantity: 1 }]; | ||
const outcomes = [{ reason: 'before_send', category: 'error', quantity: 1 }]; | ||
|
||
expect(sendBeaconSpy).toHaveBeenCalledWith( | ||
envelopeEndpoint, | ||
|
@@ -59,7 +57,7 @@ describe('BaseTransport', () => { | |
|
||
it('doesnt send beacon request when there are outcomes captured, but visibility state did not change to `hidden`', () => { | ||
const transport = new SimpleTransport({ dsn: testDsn, sendClientReports: true }); | ||
transport.recordLostEvent(Outcome.BeforeSend, 'event'); | ||
transport.recordLostEvent('before_send', 'event'); | ||
|
||
visibilityState = 'visible'; | ||
document.dispatchEvent(new Event('visibilitychange')); | ||
|
@@ -70,21 +68,21 @@ describe('BaseTransport', () => { | |
it('correctly serializes request with different categories/reasons pairs', () => { | ||
const transport = new SimpleTransport({ dsn: testDsn, sendClientReports: true }); | ||
|
||
transport.recordLostEvent(Outcome.BeforeSend, 'event'); | ||
transport.recordLostEvent(Outcome.BeforeSend, 'event'); | ||
transport.recordLostEvent(Outcome.SampleRate, 'transaction'); | ||
transport.recordLostEvent(Outcome.NetworkError, 'session'); | ||
transport.recordLostEvent(Outcome.NetworkError, 'session'); | ||
transport.recordLostEvent(Outcome.RateLimitBackoff, 'event'); | ||
transport.recordLostEvent('before_send', 'event'); | ||
transport.recordLostEvent('before_send', 'event'); | ||
transport.recordLostEvent('sample_rate', 'transaction'); | ||
transport.recordLostEvent('network_error', 'session'); | ||
transport.recordLostEvent('network_error', 'session'); | ||
transport.recordLostEvent('ratelimit_backoff', 'event'); | ||
|
||
visibilityState = 'hidden'; | ||
document.dispatchEvent(new Event('visibilitychange')); | ||
|
||
const outcomes = [ | ||
{ reason: Outcome.BeforeSend, category: 'error', quantity: 2 }, | ||
{ reason: Outcome.SampleRate, category: 'transaction', quantity: 1 }, | ||
{ reason: Outcome.NetworkError, category: 'session', quantity: 2 }, | ||
{ reason: Outcome.RateLimitBackoff, category: 'error', quantity: 1 }, | ||
{ reason: 'before_send', category: 'error', quantity: 2 }, | ||
{ reason: 'sample_rate', category: 'transaction', quantity: 1 }, | ||
{ reason: 'network_error', category: 'session', quantity: 2 }, | ||
{ reason: 'ratelimit_backoff', category: 'error', quantity: 1 }, | ||
]; | ||
|
||
expect(sendBeaconSpy).toHaveBeenCalledWith( | ||
|
@@ -97,12 +95,12 @@ describe('BaseTransport', () => { | |
const tunnel = 'https://hello.com/world'; | ||
const transport = new SimpleTransport({ dsn: testDsn, sendClientReports: true, tunnel }); | ||
|
||
transport.recordLostEvent(Outcome.BeforeSend, 'event'); | ||
transport.recordLostEvent('before_send', 'event'); | ||
|
||
visibilityState = 'hidden'; | ||
document.dispatchEvent(new Event('visibilitychange')); | ||
|
||
const outcomes = [{ reason: Outcome.BeforeSend, category: 'error', quantity: 1 }]; | ||
const outcomes = [{ reason: 'before_send', category: 'error', quantity: 1 }]; | ||
|
||
expect(sendBeaconSpy).toHaveBeenCalledWith( | ||
tunnel, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.