Skip to content

Commit 2a58ae5

Browse files
chargomeclaude
andcommitted
fix(node): use expect.objectContaining for metric attribute assertions in integration tests
ArrayContaining items are matched with strict equals (subsetEquality is not propagated), so extra attributes like sentry.timestamp.sequence and server.address caused all arrayContaining matches to fail. Wrapping with expect.objectContaining allows extra keys. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent f7bd0cb commit 2a58ae5

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • dev-packages/node-integration-tests/suites/node-runtime-metrics

dev-packages/node-integration-tests/suites/node-runtime-metrics/test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const gauge = (name: string, unit?: string) => ({
1616
type: 'gauge',
1717
...(unit ? { unit } : {}),
1818
value: expect.any(Number),
19-
attributes: SENTRY_ATTRIBUTES,
19+
attributes: expect.objectContaining(SENTRY_ATTRIBUTES),
2020
});
2121

2222
const counter = (name: string, unit?: string) => ({
@@ -26,7 +26,7 @@ const counter = (name: string, unit?: string) => ({
2626
type: 'counter',
2727
...(unit ? { unit } : {}),
2828
value: expect.any(Number),
29-
attributes: SENTRY_ATTRIBUTES,
29+
attributes: expect.objectContaining(SENTRY_ATTRIBUTES),
3030
});
3131

3232
describe('nodeRuntimeMetricsIntegration', () => {

0 commit comments

Comments
 (0)