@@ -2,7 +2,7 @@ import { getCurrentHub } from '@sentry/hub';
22import * as SentryReact from '@sentry/react' ;
33import { Integrations as TracingIntegrations } from '@sentry/tracing' ;
44import { Integration } from '@sentry/types' ;
5- import { getGlobalObject } from '@sentry/utils' ;
5+ import { getGlobalObject , logger , SentryError } from '@sentry/utils' ;
66
77import { init , Integrations , nextRouterInstrumentation } from '../src/index.client' ;
88import { NextjsOptions } from '../src/utils/nextjsOptions' ;
@@ -12,6 +12,7 @@ const { BrowserTracing } = TracingIntegrations;
1212const global = getGlobalObject ( ) ;
1313
1414const reactInit = jest . spyOn ( SentryReact , 'init' ) ;
15+ const logError = jest . spyOn ( logger , 'error' ) ;
1516
1617describe ( 'Client init()' , ( ) => {
1718 afterEach ( ( ) => {
@@ -50,6 +51,18 @@ describe('Client init()', () => {
5051 expect ( currentScope . _tags ) . toEqual ( { runtime : 'browser' } ) ;
5152 } ) ;
5253
54+ it ( 'adds 404 transaction filter' , ( ) => {
55+ init ( {
56+ dsn :
'https://[email protected] /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+
5366 describe ( 'integrations' , ( ) => {
5467 it ( 'does not add BrowserTracing integration by default if tracesSampleRate is not set' , ( ) => {
5568 init ( { } ) ;
0 commit comments