Skip to content

Commit e646c3f

Browse files
committed
Add unnamed / named import test scenarios for tracing package.
1 parent f91ad30 commit e646c3f

File tree

5 files changed

+36
-10
lines changed

5 files changed

+36
-10
lines changed

packages/node-integration-tests/suites/send-transaction/manual-tracing/test.ts

Lines changed: 0 additions & 10 deletions
This file was deleted.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import * as Sentry from '@sentry/node';
2+
import * as _ from '@sentry/tracing';
3+
4+
Sentry.init({
5+
dsn: 'https://[email protected]/1337',
6+
release: '1.0',
7+
tracesSampleRate: 1.0,
8+
});
9+
10+
const transaction = Sentry.startTransaction({ name: 'test_transaction_1' });
11+
12+
transaction.finish();
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { assertSentryTransaction, getEnvelopeRequest, runServer } from '../../../utils';
2+
3+
test('should send a manually started transaction when @sentry/tracing is imported using named import.', async () => {
4+
const url = await runServer(__dirname);
5+
const envelope = await getEnvelopeRequest(url);
6+
7+
expect(envelope).toHaveLength(3);
8+
9+
assertSentryTransaction(envelope[2], {
10+
transaction: 'test_transaction_1',
11+
});
12+
});
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { assertSentryTransaction, getEnvelopeRequest, runServer } from '../../../utils';
2+
3+
test('should send a manually started transaction when @sentry/tracing is imported using unnamed import.', async () => {
4+
const url = await runServer(__dirname);
5+
const envelope = await getEnvelopeRequest(url);
6+
7+
expect(envelope).toHaveLength(3);
8+
9+
assertSentryTransaction(envelope[2], {
10+
transaction: 'test_transaction_1',
11+
});
12+
});

0 commit comments

Comments
 (0)