File tree Expand file tree Collapse file tree 3 files changed +28
-0
lines changed
Expand file tree Collapse file tree 3 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ import LearningPathDetailPage from './learningpath/LearningPathDetails';
1919import CourseDetailPage from './learningpath/CourseDetails' ;
2020
2121import './index.scss' ;
22+ import './setupConsoleOverride' ;
2223
2324subscribe ( APP_READY , ( ) => {
2425 const root = ReactDOM . createRoot ( document . getElementById ( 'root' ) ) ;
Original file line number Diff line number Diff line change 1+ // Suppress warnings in test and development environments.
2+ /* eslint-disable no-console */
3+
4+ if ( process . env . NODE_ENV === 'test' || process . env . NODE_ENV === 'development' ) {
5+ const originalConsoleError = console . error ;
6+ console . error = ( ...args ) => {
7+ if (
8+ typeof args [ 0 ] === 'string'
9+ && args [ 0 ] . includes ( 'Support for defaultProps will be removed from function components in a future major release.' )
10+ && typeof args [ 2 ] === 'string'
11+ && args [ 2 ] . includes ( '/@openedx/paragon' )
12+ ) {
13+ return ;
14+ }
15+
16+ if ( typeof args [ 1 ] === 'string' && ( args [ 1 ] . includes ( 'SiteFooter' ) || args [ 1 ] . includes ( 'LearningHeader' ) ) ) {
17+ return ;
18+ }
19+
20+ if ( typeof args [ 3 ] === 'string' && args [ 3 ] . includes ( 'LearningHeader' ) ) {
21+ return ;
22+ }
23+
24+ originalConsoleError ( ...args ) ;
25+ } ;
26+ }
Original file line number Diff line number Diff line change 11import 'core-js/stable' ;
22import 'regenerator-runtime/runtime' ;
3+ import './setupConsoleOverride' ;
You can’t perform that action at this time.
0 commit comments