File tree Expand file tree Collapse file tree 6 files changed +88
-0
lines changed
packages/node-integration-tests/suites/public-api/addBreadcrumb Expand file tree Collapse file tree 6 files changed +88
-0
lines changed Original file line number Diff line number Diff line change 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 . addBreadcrumb ( { } ) ;
9+ Sentry . captureMessage ( 'test-empty-obj' ) ;
Original file line number Diff line number Diff line change 1+ import { assertSentryEvent , getEventRequest , runServer } from '../../../../utils' ;
2+
3+ test ( 'should add an empty breadcrumb, when an empty object is given' , async ( ) => {
4+ const url = await runServer ( __dirname ) ;
5+ const requestBody = await getEventRequest ( url ) ;
6+
7+ assertSentryEvent ( requestBody , {
8+ message : 'test-empty-obj' ,
9+ } ) ;
10+ } ) ;
Original file line number Diff line number Diff line change 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 . addBreadcrumb ( {
9+ category : 'foo' ,
10+ message : 'bar' ,
11+ level : Sentry . Severity . Critical ,
12+ } ) ;
13+
14+ Sentry . addBreadcrumb ( {
15+ category : 'qux' ,
16+ } ) ;
17+
18+ Sentry . captureMessage ( 'test_multi_breadcrumbs' ) ;
Original file line number Diff line number Diff line change 1+ import { assertSentryEvent , getEventRequest , runServer } from '../../../../utils' ;
2+
3+ test ( 'should add multiple breadcrumbs' , async ( ) => {
4+ const url = await runServer ( __dirname ) ;
5+ const requestBody = await getEventRequest ( url ) ;
6+
7+ assertSentryEvent ( requestBody , {
8+ message : 'test_multi_breadcrumbs' ,
9+ breadcrumbs : [
10+ {
11+ category : 'foo' ,
12+ message : 'bar' ,
13+ level : 'critical' ,
14+ } ,
15+ {
16+ category : 'qux' ,
17+ } ,
18+ ] ,
19+ } ) ;
20+ } ) ;
Original file line number Diff line number Diff line change 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 . addBreadcrumb ( {
9+ category : 'foo' ,
10+ message : 'bar' ,
11+ level : Sentry . Severity . Critical ,
12+ } ) ;
13+
14+ Sentry . captureMessage ( 'test_simple' ) ;
Original file line number Diff line number Diff line change 1+ import { assertSentryEvent , getEventRequest , runServer } from '../../../../utils' ;
2+
3+ test ( 'should add a simple breadcrumb' , async ( ) => {
4+ const url = await runServer ( __dirname ) ;
5+ const requestBody = await getEventRequest ( url ) ;
6+
7+ assertSentryEvent ( requestBody , {
8+ message : 'test_simple' ,
9+ breadcrumbs : [
10+ {
11+ category : 'foo' ,
12+ message : 'bar' ,
13+ level : 'critical' ,
14+ } ,
15+ ] ,
16+ } ) ;
17+ } ) ;
You can’t perform that action at this time.
0 commit comments