File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -54,3 +54,18 @@ export const mkdtempSyncSpy = jest.spyOn(fs, 'mkdtempSync');
54
54
afterEach ( ( ) => {
55
55
mkdtempSyncSpy . mockClear ( ) ;
56
56
} ) ;
57
+
58
+ // TODO (v8): This shouldn't be necessary once `hideSourceMaps` gets a default value, even for the updated error message
59
+ // eslint-disable-next-line @typescript-eslint/unbound-method
60
+ const realConsoleWarn = global . console . warn ;
61
+ global . console . warn = ( ...args : unknown [ ] ) => {
62
+ // Suppress the warning message about the `hideSourceMaps` option. This is better than forcing a value for
63
+ // `hideSourceMaps` because that would mean we couldn't test it easily and would muddy the waters of other tests. Note
64
+ // that doing this here, as a side effect, only works because the tests which trigger this warning are the same tests
65
+ // which need other mocks from this file.
66
+ if ( typeof args [ 0 ] === 'string' && args [ 0 ] . includes ( 'your original code may be visible in browser devtools' ) ) {
67
+ return ;
68
+ }
69
+
70
+ return realConsoleWarn ( ...args ) ;
71
+ } ;
Original file line number Diff line number Diff line change @@ -6,6 +6,9 @@ const moduleExports = {
6
6
} ,
7
7
sentry : {
8
8
experiments : { autoWrapDataFetchers : true } ,
9
+ // Suppress the warning message from `handleSourcemapHidingOptionWarning` in `src/config/webpack.ts`
10
+ // TODO (v8): This can come out in v8, because this option will get a default value
11
+ hideSourceMaps : false ,
9
12
} ,
10
13
} ;
11
14
const SentryWebpackPluginOptions = {
You can’t perform that action at this time.
0 commit comments