Skip to content

Commit 5855f26

Browse files
committed
rename fetch callback
1 parent c7f0b42 commit 5855f26

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

packages/tracing/src/browser/request.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export function registerRequestInstrumentation(_options?: Partial<RequestInstrum
114114
if (traceFetch) {
115115
addInstrumentationHandler({
116116
callback: (handlerData: FetchData) => {
117-
_fetchCallback(handlerData, shouldCreateSpan, spans);
117+
fetchCallback(handlerData, shouldCreateSpan, spans);
118118
},
119119
type: 'fetch',
120120
});
@@ -133,7 +133,7 @@ export function registerRequestInstrumentation(_options?: Partial<RequestInstrum
133133
/**
134134
* Create and track fetch request spans
135135
*/
136-
export function _fetchCallback(
136+
export function fetchCallback(
137137
handlerData: FetchData,
138138
shouldCreateSpan: (url: string) => boolean,
139139
spans: Record<string, Span>,

packages/tracing/test/browser/request.test.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { BrowserClient } from '@sentry/browser';
22
import { Hub, makeMain } from '@sentry/hub';
33

44
import { Span, SpanStatus, Transaction } from '../../src';
5-
import { _fetchCallback, FetchData, registerRequestInstrumentation } from '../../src/browser/request';
5+
import { fetchCallback, FetchData, registerRequestInstrumentation } from '../../src/browser/request';
66
import { addExtensionMethods } from '../../src/hubextensions';
77

88
declare global {
@@ -96,7 +96,7 @@ describe('_fetchCallback()', () => {
9696
};
9797
const spans = {};
9898

99-
_fetchCallback(data, shouldCreateSpan, spans);
99+
fetchCallback(data, shouldCreateSpan, spans);
100100
expect(spans).toEqual({});
101101
});
102102

@@ -108,7 +108,7 @@ describe('_fetchCallback()', () => {
108108
};
109109
const spans = {};
110110

111-
_fetchCallback(data, shouldCreateSpan, spans);
111+
fetchCallback(data, shouldCreateSpan, spans);
112112
expect(spans).toEqual({});
113113
});
114114

@@ -125,7 +125,7 @@ describe('_fetchCallback()', () => {
125125
const spans: Record<string, Span> = {};
126126

127127
// Start fetch request
128-
_fetchCallback(data, shouldCreateSpan, spans);
128+
fetchCallback(data, shouldCreateSpan, spans);
129129
const spanKey = Object.keys(spans)[0];
130130

131131
const fetchSpan = spans[spanKey];
@@ -149,7 +149,7 @@ describe('_fetchCallback()', () => {
149149
};
150150

151151
// End fetch request
152-
_fetchCallback(newData, shouldCreateSpan, spans);
152+
fetchCallback(newData, shouldCreateSpan, spans);
153153
expect(spans).toEqual({});
154154
if (transaction.spanRecorder) {
155155
expect(transaction.spanRecorder.spans[1].endTimestamp).toBeDefined();
@@ -171,15 +171,15 @@ describe('_fetchCallback()', () => {
171171
const spans: Record<string, Span> = {};
172172

173173
// Start fetch request
174-
_fetchCallback(data, shouldCreateSpan, spans);
174+
fetchCallback(data, shouldCreateSpan, spans);
175175

176176
const newData = {
177177
...data,
178178
endTimestamp: data.startTimestamp + 12343234,
179179
response: { status: 404 } as Response,
180180
};
181181
// End fetch request
182-
_fetchCallback(newData, shouldCreateSpan, spans);
182+
fetchCallback(newData, shouldCreateSpan, spans);
183183
if (transaction.spanRecorder) {
184184
expect(transaction.spanRecorder.spans[1].status).toBe(SpanStatus.fromHttpCode(404));
185185
} else {

0 commit comments

Comments
 (0)