8000 test(node): Add `setTags` integration tests (#4794) · michax/sentry-javascript@18fda84 · GitHub
[go: up one dir, main page]

Skip to content

Commit 18fda84

Browse files
authored
test(node): Add setTags integration tests (getsentry#4794)
1 parent a1d1e97 commit 18fda84

File tree

2 files changed

+32
-0
lines changed
  • packages/node-integration-tests/suites/public-api/setTags/with-primitives

2 files changed

+32
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import * as Sentry from '@sentry/node';
2+
3+
Sentry.init({
4+
dsn: 'https://public@dsn.ingest.sentry.io/1337',
5+
release: '1.0',
6+
});
7+
8+
Sentry.setTag('tag_1', 'foo');
9+
Sentry.setTag('tag_2', Math.PI);
10+
Sentry.setTag('tag_3', false);
11+
Sentry.setTag('tag_4', null);
12+
Sentry.setTag('tag_5', undefined);
13+
Sentry.setTag('tag_6', -1);
14+
15+
Sentry.captureMessage('primitive_tags');
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { assertSentryEvent, getEventRequest, runServer } from '../../../../utils';
2+
3+
test('should set primitive tags', async () => {
4+
const url = await runServer(__dirname);
5+
const requestBody = await getEventRequest(url);
6+
7+
assertSentryEvent(requestBody, {
8+
message: 'primitive_tags',
9+
tags: {
10+
tag_1: 'foo',
11+
tag_2: 3.141592653589793,
12+
tag_3: false,
13+
tag_4: null,
14+
tag_6: -1,
15+
},
16+
});
17+
});

0 commit comments

Comments
 (0)
0