@@ -2,7 +2,7 @@ import { getCurrentHub } from '@sentry/hub';
2
2
import * as SentryReact from '@sentry/react' ;
3
3
import { Integrations as TracingIntegrations } from '@sentry/tracing' ;
4
4
import { Integration } from '@sentry/types' ;
5
- import { getGlobalObject } from '@sentry/utils' ;
5
+ import { getGlobalObject , logger , SentryError } from '@sentry/utils' ;
6
6
7
7
import { init , Integrations , nextRouterInstrumentation } from '../src/index.client' ;
8
8
import { NextjsOptions } from '../src/utils/nextjsOptions' ;
@@ -12,6 +12,7 @@ const { BrowserTracing } = TracingIntegrations;
12
12
const global = getGlobalObject ( ) ;
13
13
14
14
const reactInit = jest . spyOn ( SentryReact , 'init' ) ;
15
+ const logError = jest . spyOn ( logger , 'error' ) ;
15
16
16
17
describe ( 'Client init()' , ( ) => {
17
18
afterEach ( ( ) => {
@@ -50,6 +51,18 @@ describe('Client init()', () => {
50
51
expect ( currentScope . _tags ) . toEqual ( { runtime : 'browser' } ) ;
51
52
} ) ;
52
53
54
+ it ( 'adds 404 transaction filter' , ( ) => {
55
+ init ( {
56
+ dsn : 'https://dogsarebadatkeepingsecrets@squirrelchasers.ingest.sentry.io/12312012' ,
57
+ tracesSampleRate : 1.0 ,
58
+ } ) ;
59
+
60
+ const transaction = getCurrentHub ( ) . startTransaction ( { name : '/404' } ) ;
61
+ transaction . finish ( ) ;
62
+
63
+ expect ( logError ) . toHaveBeenCalledWith ( new SentryError ( 'An event processor returned null, will not send event.' ) ) ;
64
+ } ) ;
65
+
53
66
describe ( 'integrations' , ( ) => {
54
67
it ( 'does not add BrowserTracing integration by default if tracesSampleRate is not set' , ( ) => {
55
68
init ( { } ) ;
0 commit comments