@@ -5,9 +5,8 @@ import { Scope } from '@sentry/node';
55import { getGlobalScope } from '@sentry/node' ;
66import { SDK_VERSION } from '@sentry/node' ;
77import { beforeEach , describe , expect , it , vi } from 'vitest' ;
8- import type { SentryNuxtServerOptions } from '../../src/common/types' ;
98import { init } from '../../src/server' ;
10- import { clientSourceMapErrorFilter , mergeRegisterEsmLoaderHooks } from '../../src/server/sdk' ;
9+ import { clientSourceMapErrorFilter } from '../../src/server/sdk' ;
1110
1211const nodeInit = vi . spyOn ( SentryNode , 'init' ) ;
1312
@@ -163,42 +162,4 @@ describe('Nuxt Server SDK', () => {
163162 } ) ;
164163 } ) ;
165164 } ) ;
166-
167- describe ( 'mergeRegisterEsmLoaderHooks' , ( ) => {
168- it ( 'merges exclude array when registerEsmLoaderHooks is an object with an exclude array' , ( ) => {
169- const options : SentryNuxtServerOptions = {
170- registerEsmLoaderHooks : { exclude : [ / t e s t / ] } ,
171- } ;
172- const result = mergeRegisterEsmLoaderHooks ( options ) ;
173- expect ( result ) . toEqual ( { exclude : [ / t e s t / , / v u e / ] } ) ;
174- } ) ;
175-
176- it ( 'sets exclude array when registerEsmLoaderHooks is an object without an exclude array' , ( ) => {
177- const options : SentryNuxtServerOptions = {
178- registerEsmLoaderHooks : { } ,
179- } ;
180- const result = mergeRegisterEsmLoaderHooks ( options ) ;
181- expect ( result ) . toEqual ( { exclude : [ / v u e / ] } ) ;
182- } ) ;
183-
184- it ( 'returns boolean when registerEsmLoaderHooks is a boolean' , ( ) => {
185- const options1 : SentryNuxtServerOptions = {
186- registerEsmLoaderHooks : true ,
187- } ;
188- const result1 = mergeRegisterEsmLoaderHooks ( options1 ) ;
189- expect ( result1 ) . toBe ( true ) ;
190-
191- const options2 : SentryNuxtServerOptions = {
192- registerEsmLoaderHooks : false ,
193- } ;
194- const result2 = mergeRegisterEsmLoaderHooks ( options2 ) ;
195- expect ( result2 ) . toBe ( false ) ;
196- } ) ;
197-
198- it ( 'sets exclude array when registerEsmLoaderHooks is undefined' , ( ) => {
199- const options : SentryNuxtServerOptions = { } ;
200- const result = mergeRegisterEsmLoaderHooks ( options ) ;
201- expect ( result ) . toEqual ( { exclude : [ / v u e / ] } ) ;
202- } ) ;
203- } ) ;
204165} ) ;
0 commit comments