File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,11 @@ describe('Expect the <Parallax> component', () => {
1414
1515 it ( 'to throw if the ParallaxController is not available' , ( ) => {
1616 const node = document . createElement ( 'div' ) ;
17+ // NOTE: hide error and react warning
18+ // see issue: https://github.com/facebook/jest/issues/4597
19+ const preventError = e => e . preventDefault ( ) ;
20+ window . addEventListener ( 'error' , preventError , true ) ;
21+ Error . prototype . suppressReactErrorLogging = true ;
1722
1823 const render = ( ) => {
1924 ReactDOM . render (
@@ -27,6 +32,9 @@ describe('Expect the <Parallax> component', () => {
2732 expect ( render ) . toThrow (
2833 "Must wrap your application's <Parallax /> components in a <ParallaxProvider />."
2934 ) ;
35+
36+ window . removeEventListener ( 'error' , preventError , true ) ;
37+ Error . prototype . suppressReactErrorLogging = false ;
3038 } ) ;
3139
3240 it ( 'to warn if the ParallaxController is found but not provided by <ParallaxProvider>' , ( ) => {
You can’t perform that action at this time.
0 commit comments