@@ -147,8 +147,10 @@ describe('sentryOnBuildEnd', () => {
147147
148148 await sentryOnBuildEnd ( config ) ;
149149
150+ expect ( mockSentryCliInstance . releases . uploadSourceMaps ) . toHaveBeenCalledTimes ( 1 ) ;
150151 expect ( mockSentryCliInstance . releases . uploadSourceMaps ) . toHaveBeenCalledWith ( 'undefined' , {
151152 include : [ { paths : [ '/build' ] } ] ,
153+ live : 'rejectOnError' ,
152154 } ) ;
153155 } ) ;
154156
@@ -249,6 +251,8 @@ describe('sentryOnBuildEnd', () => {
249251 mockSentryCliInstance . execute . mockRejectedValueOnce ( new Error ( 'Injection failed' ) ) ;
250252
251253 await sentryOnBuildEnd ( defaultConfig ) ;
254+ expect ( mockSentryCliInstance . execute ) . toHaveBeenCalledTimes ( 1 ) ;
255+ expect ( mockSentryCliInstance . execute ) . toHaveBeenCalledWith ( [ 'sourcemaps' , 'inject' , '/build' ] , false ) ;
252256
253257 expect ( consoleSpy ) . toHaveBeenCalledWith ( '[Sentry] Could not inject debug ids' , expect . any ( Error ) ) ;
254258 consoleSpy . mockRestore ( ) ;
@@ -282,6 +286,9 @@ describe('sentryOnBuildEnd', () => {
282286
283287 expect ( consoleSpy ) . toHaveBeenCalledWith ( expect . stringContaining ( '[Sentry] Automatically setting' ) ) ;
284288 expect ( consoleSpy ) . toHaveBeenCalledWith ( expect . stringContaining ( 'Deleting asset after upload:' ) ) ;
289+ // rejectOnError is used in debug mode to pipe debug id injection output from the CLI to this process's stdout
290+ expect ( mockSentryCliInstance . execute ) . toHaveBeenCalledWith ( [ 'sourcemaps' , 'inject' , '/build' ] , 'rejectOnError' ) ;
291+
285292 consoleSpy . mockRestore ( ) ;
286293 } ) ;
287294
0 commit comments