Skip to content

Commit 32b3717

Browse files
committed
check for ttfb in seconds range
1 parent dc2085d commit 32b3717

File tree

1 file changed

+6
-0
lines changed
  • dev-packages/browser-integration-tests/suites/tracing/metrics/pageload-resource-spans

1 file changed

+6
-0
lines changed

dev-packages/browser-integration-tests/suites/tracing/metrics/pageload-resource-spans/test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,12 @@ sentryTest('adds resource spans to pageload transaction', async ({ getLocalTestU
110110
trace_id: traceId,
111111
});
112112

113+
// range check: TTFB must be >0 (at least in this case) and it's reasonable to
114+
// assume <10 seconds. This also tests that we're reporting TTFB in seconds.
115+
const imgSpanTtfb = imgSpan?.data['http.request.time_to_first_byte'];
116+
expect(imgSpanTtfb).toBeGreaterThan(0);
117+
expect(imgSpanTtfb).toBeLessThan(10);
118+
113119
expect(linkSpan).toEqual({
114120
data: {
115121
'http.decoded_response_content_length': expect.any(Number),

0 commit comments

Comments
 (0)