Skip to content

Commit 0653b73

Browse files
committed
add some unit tests
1 parent d439d94 commit 0653b73

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

packages/astro/test/server/sdk.test.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,27 @@ describe('Sentry server SDK', () => {
4141
it('returns client from init', () => {
4242
expect(init({})).not.toBeUndefined();
4343
});
44+
45+
it('configures ignoreSpans to drop prerendered http.server spans', () => {
46+
init({});
47+
48+
expect(nodeInit).toHaveBeenCalledWith(
49+
expect.objectContaining({
50+
ignoreSpans: expect.arrayContaining([
51+
{ op: 'http.server', attributes: { 'sentry.origin': 'auto.http.otel.http' } },
52+
]),
53+
}),
54+
);
55+
});
56+
57+
it('preserves user-provided ignoreSpans entries', () => {
58+
init({ ignoreSpans: [/keep-me/] });
59+
60+
expect(nodeInit).toHaveBeenCalledWith(
61+
expect.objectContaining({
62+
ignoreSpans: expect.arrayContaining([/keep-me/]),
63+
}),
64+
);
65+
});
4466
});
4567
});

0 commit comments

Comments
 (0)