Skip to content

Commit c88c241

Browse files
committed
fix test
1 parent 641c08c commit c88c241

File tree

1 file changed

+33
-31
lines changed

1 file changed

+33
-31
lines changed

packages/replay/test/unit/flush.test.ts

Lines changed: 33 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -179,37 +179,39 @@ it('long first flush enqueues following events', async () => {
179179
});
180180

181181
// Add this to test that segment ID increases
182-
mockAddPerformanceEntries.mockImplementationOnce(() => {
183-
createPerformanceSpans(
184-
replay,
185-
createPerformanceEntries([
186-
{
187-
name: 'https://sentry.io/foo.js',
188-
entryType: 'resource',
189-
startTime: 176.59999990463257,
190-
duration: 5.600000023841858,
191-
initiatorType: 'link',
192-
nextHopProtocol: 'h2',
193-
workerStart: 177.5,
194-
redirectStart: 0,
195-
redirectEnd: 0,
196-
fetchStart: 177.69999992847443,
197-
domainLookupStart: 177.69999992847443,
198-
domainLookupEnd: 177.69999992847443,
199-
connectStart: 177.69999992847443,
200-
connectEnd: 177.69999992847443,
201-
secureConnectionStart: 177.69999992847443,
202-
requestStart: 177.5,
203-
responseStart: 181,
204-
responseEnd: 182.19999992847443,
205-
transferSize: 0,
206-
encodedBodySize: 0,
207-
decodedBodySize: 0,
208-
serverTiming: [],
209-
} as unknown as PerformanceResourceTiming,
210-
]),
211-
);
212-
});
182+
mockAddPerformanceEntries.mockImplementationOnce(() =>
183+
Promise.all(
184+
createPerformanceSpans(
185+
replay,
186+
createPerformanceEntries([
187+
{
188+
name: 'https://sentry.io/foo.js',
189+
entryType: 'resource',
190+
startTime: 176.59999990463257,
191+
duration: 5.600000023841858,
192+
initiatorType: 'link',
193+
nextHopProtocol: 'h2',
194+
workerStart: 177.5,
195+
redirectStart: 0,
196+
redirectEnd: 0,
197+
fetchStart: 177.69999992847443,
198+
domainLookupStart: 177.69999992847443,
199+
domainLookupEnd: 177.69999992847443,
200+
connectStart: 177.69999992847443,
201+
connectEnd: 177.69999992847443,
202+
secureConnectionStart: 177.69999992847443,
203+
requestStart: 177.5,
204+
responseStart: 181,
205+
responseEnd: 182.19999992847443,
206+
transferSize: 0,
207+
encodedBodySize: 0,
208+
decodedBodySize: 0,
209+
serverTiming: [],
210+
} as unknown as PerformanceResourceTiming,
211+
]),
212+
),
213+
),
214+
);
213215
// flush #5 @ t=25s - debounced flush calls `flush`
214216
// 20s + `flushMinDelay` which is 5 seconds
215217
await advanceTimers(DEFAULT_FLUSH_MIN_DELAY);

0 commit comments

Comments
 (0)