@@ -147,8 +147,10 @@ describe('sentryOnBuildEnd', () => {
147
147
148
148
await sentryOnBuildEnd ( config ) ;
149
149
150
+ expect ( mockSentryCliInstance . releases . uploadSourceMaps ) . toHaveBeenCalledTimes ( 1 ) ;
150
151
expect ( mockSentryCliInstance . releases . uploadSourceMaps ) . toHaveBeenCalledWith ( 'undefined' , {
151
152
include : [ { paths : [ '/build' ] } ] ,
153
+ live : 'rejectOnError' ,
152
154
} ) ;
153
155
} ) ;
154
156
@@ -249,6 +251,8 @@ describe('sentryOnBuildEnd', () => {
249
251
mockSentryCliInstance . execute . mockRejectedValueOnce ( new Error ( 'Injection failed' ) ) ;
250
252
251
253
await sentryOnBuildEnd ( defaultConfig ) ;
254
+ expect ( mockSentryCliInstance . execute ) . toHaveBeenCalledTimes ( 1 ) ;
255
+ expect ( mockSentryCliInstance . execute ) . toHaveBeenCalledWith ( [ 'sourcemaps' , 'inject' , '/build' ] , false ) ;
252
256
253
257
expect ( consoleSpy ) . toHaveBeenCalledWith ( '[Sentry] Could not inject debug ids' , expect . any ( Error ) ) ;
254
258
consoleSpy . mockRestore ( ) ;
@@ -282,6 +286,9 @@ describe('sentryOnBuildEnd', () => {
282
286
283
287
expect ( consoleSpy ) . toHaveBeenCalledWith ( expect . stringContaining ( '[Sentry] Automatically setting' ) ) ;
284
288
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
+
285
292
consoleSpy . mockRestore ( ) ;
286
293
} ) ;
287
294
0 commit comments