@@ -169,72 +169,74 @@ describe('metroconfig', () => {
169169 } ) ) ;
170170 } ) ;
171171
172- test ( 'keep Web Replay when platform is web and includeWebReplay is true' , ( ) => {
173- const modifiedConfig = withSentryResolver ( config , true ) ;
174- resolveRequest ( modifiedConfig , contextMock , '@sentry/replay' , 'web' ) ;
172+ describe . each ( [ [ '@sentry/replay' ] , [ '@sentry-internal/replay' ] ] ) ( 'with %s' , replayPackage => {
173+ test ( 'keep Web Replay when platform is web and includeWebReplay is true' , ( ) => {
174+ const modifiedConfig = withSentryResolver ( config , true ) ;
175+ resolveRequest ( modifiedConfig , contextMock , replayPackage , 'web' ) ;
175176
176- ExpectToBeCalledWithMetroParameters ( originalResolverMock , contextMock , '@sentry/replay' , 'web' ) ;
177- } ) ;
177+ ExpectToBeCalledWithMetroParameters ( originalResolverMock , contextMock , replayPackage , 'web' ) ;
178+ } ) ;
178179
179- test ( 'removes Web Replay when platform is web and includeWebReplay is false' , ( ) => {
180- const modifiedConfig = withSentryResolver ( config , false ) ;
181- const result = resolveRequest ( modifiedConfig , contextMock , '@sentry/replay' , 'web' ) ;
180+ test ( 'removes Web Replay when platform is web and includeWebReplay is false' , ( ) => {
181+ const modifiedConfig = withSentryResolver ( config , false ) ;
182+ const result = resolveRequest ( modifiedConfig , contextMock , replayPackage , 'web' ) ;
182183
183- expect ( result ) . toEqual ( { type : 'empty' } ) ;
184- expect ( originalResolverMock ) . not . toHaveBeenCalled ( ) ;
185- } ) ;
184+ expect ( result ) . toEqual ( { type : 'empty' } ) ;
185+ expect ( originalResolverMock ) . not . toHaveBeenCalled ( ) ;
186+ } ) ;
186187
187- test ( 'keep Web Replay when platform is android and includeWebReplay is true' , ( ) => {
188- const modifiedConfig = withSentryResolver ( config , true ) ;
189- resolveRequest ( modifiedConfig , contextMock , '@sentry/replay' , 'android' ) ;
188+ test ( 'keep Web Replay when platform is android and includeWebReplay is true' , ( ) => {
189+ const modifiedConfig = withSentryResolver ( config , true ) ;
190+ resolveRequest ( modifiedConfig , contextMock , replayPackage , 'android' ) ;
190191
191- ExpectToBeCalledWithMetroParameters ( originalResolverMock , contextMock , '@sentry/replay' , 'android' ) ;
192- } ) ;
192+ ExpectToBeCalledWithMetroParameters ( originalResolverMock , contextMock , replayPackage , 'android' ) ;
193+ } ) ;
193194
194- test ( 'removes Web Replay when platform is android and includeWebReplay is false' , ( ) => {
195- const modifiedConfig = withSentryResolver ( config , false ) ;
196- const result = resolveRequest ( modifiedConfig , contextMock , '@sentry/replay' , 'android' ) ;
195+ test ( 'removes Web Replay when platform is android and includeWebReplay is false' , ( ) => {
196+ const modifiedConfig = withSentryResolver ( config , false ) ;
197+ const result = resolveRequest ( modifiedConfig , contextMock , replayPackage , 'android' ) ;
197198
198- expect ( result ) . toEqual ( { type : 'empty' } ) ;
199- expect ( originalResolverMock ) . not . toHaveBeenCalled ( ) ;
200- } ) ;
199+ expect ( result ) . toEqual ( { type : 'empty' } ) ;
200+ expect ( originalResolverMock ) . not . toHaveBeenCalled ( ) ;
201+ } ) ;
201202
202- test ( 'removes Web Replay when platform is android and includeWebReplay is undefined' , ( ) => {
203- const modifiedConfig = withSentryResolver ( config , undefined ) ;
204- const result = resolveRequest ( modifiedConfig , contextMock , '@sentry/replay' , 'android' ) ;
203+ test ( 'removes Web Replay when platform is android and includeWebReplay is undefined' , ( ) => {
204+ const modifiedConfig = withSentryResolver ( config , undefined ) ;
205+ const result = resolveRequest ( modifiedConfig , contextMock , replayPackage , 'android' ) ;
205206
206- expect ( result ) . toEqual ( { type : 'empty' } ) ;
207- expect ( originalResolverMock ) . not . toHaveBeenCalled ( ) ;
208- } ) ;
207+ expect ( result ) . toEqual ( { type : 'empty' } ) ;
208+ expect ( originalResolverMock ) . not . toHaveBeenCalled ( ) ;
209+ } ) ;
209210
210- test ( 'keep Web Replay when platform is undefined and includeWebReplay is null' , ( ) => {
211- const modifiedConfig = withSentryResolver ( config , undefined ) ;
212- resolveRequest ( modifiedConfig , contextMock , '@sentry/replay' , null ) ;
211+ test ( 'keep Web Replay when platform is undefined and includeWebReplay is null' , ( ) => {
212+ const modifiedConfig = withSentryResolver ( config , undefined ) ;
213+ resolveRequest ( modifiedConfig , contextMock , replayPackage , null ) ;
213214
214- ExpectToBeCalledWithMetroParameters ( originalResolverMock , contextMock , '@sentry/replay' , null ) ;
215- } ) ;
215+ ExpectToBeCalledWithMetroParameters ( originalResolverMock , contextMock , replayPackage , null ) ;
216+ } ) ;
216217
217- test ( 'keep Web Replay when platform is ios and includeWebReplay is true' , ( ) => {
218- const modifiedConfig = withSentryResolver ( config , true ) ;
219- resolveRequest ( modifiedConfig , contextMock , '@sentry/replay' , 'ios' ) ;
218+ test ( 'keep Web Replay when platform is ios and includeWebReplay is true' , ( ) => {
219+ const modifiedConfig = withSentryResolver ( config , true ) ;
220+ resolveRequest ( modifiedConfig , contextMock , replayPackage , 'ios' ) ;
220221
221- ExpectToBeCalledWithMetroParameters ( originalResolverMock , contextMock , '@sentry/replay' , 'ios' ) ;
222- } ) ;
222+ ExpectToBeCalledWithMetroParameters ( originalResolverMock , contextMock , replayPackage , 'ios' ) ;
223+ } ) ;
223224
224- test ( 'removes Web Replay when platform is ios and includeWebReplay is false' , ( ) => {
225- const modifiedConfig = withSentryResolver ( config , false ) ;
226- const result = resolveRequest ( modifiedConfig , contextMock , '@sentry/replay' , 'ios' ) ;
225+ test ( 'removes Web Replay when platform is ios and includeWebReplay is false' , ( ) => {
226+ const modifiedConfig = withSentryResolver ( config , false ) ;
227+ const result = resolveRequest ( modifiedConfig , contextMock , replayPackage , 'ios' ) ;
227228
228- expect ( result ) . toEqual ( { type : 'empty' } ) ;
229- expect ( originalResolverMock ) . not . toHaveBeenCalled ( ) ;
230- } ) ;
229+ expect ( result ) . toEqual ( { type : 'empty' } ) ;
230+ expect ( originalResolverMock ) . not . toHaveBeenCalled ( ) ;
231+ } ) ;
231232
232- test ( 'removes Web Replay when platform is ios and includeWebReplay is undefined' , ( ) => {
233- const modifiedConfig = withSentryResolver ( config , undefined ) ;
234- const result = resolveRequest ( modifiedConfig , contextMock , '@sentry/replay' , 'ios' ) ;
233+ test ( 'removes Web Replay when platform is ios and includeWebReplay is undefined' , ( ) => {
234+ const modifiedConfig = withSentryResolver ( config , undefined ) ;
235+ const result = resolveRequest ( modifiedConfig , contextMock , replayPackage , 'ios' ) ;
235236
236- expect ( result ) . toEqual ( { type : 'empty' } ) ;
237- expect ( originalResolverMock ) . not . toHaveBeenCalled ( ) ;
237+ expect ( result ) . toEqual ( { type : 'empty' } ) ;
238+ expect ( originalResolverMock ) . not . toHaveBeenCalled ( ) ;
239+ } ) ;
238240 } ) ;
239241
240242 test ( 'calls originalResolver when moduleName is not @sentry/replay' , ( ) => {
0 commit comments