import '@testing-library/jest-dom' ; class ResizeObserver { observe ( ) { } unobserve ( ) { } disconnect ( ) { } } window . ResizeObserver = ResizeObserver ; [ 'offsetWidth' , 'offsetHeight' ] . forEach ( ( prop ) => { Object . defineProperty ( HTMLElement . prototype , prop , { configurable : true , value : 500 , } ) ; } ) ; afterEach ( ( ) => { window . localStorage . clear ( ) ; } ) ; let usedConsole = false ; [ 'log' , 'error' , 'warn' ] . forEach ( ( key ) => { const originalFn = console [ key ] ; console [ key ] = ( ... args ) => { usedConsole = true ; originalFn ( ... args ) ; } ; } ) ; afterEach ( ( ) => { if ( usedConsole ) { usedConsole = false ; throw `To keep the test output readable you should remove all usages of \`console\`.
They mostly refer to fixable errors, warnings and deprecations or forgotten debugging statements.

If your test relies on \`console\` you should mock it:

const errorSpy = mockConsoleMethod('error');
// Your test goes here
errorSpy.mockRestore(); // optional if end of test
` ; } } ) ;