File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
src/components/ErrorBoundary Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 1
1
import { render } from '@testing-library/react' ;
2
- import React , { ComponentType } from 'react' ;
2
+ import React from 'react' ;
3
3
import { create } from 'react-test-renderer' ;
4
4
import ErrorBoundary from './ErrorBoundary' ;
5
5
@@ -13,7 +13,7 @@ const ComponentWithError = ({ shouldThrow }: { shouldThrow?: boolean }) => {
13
13
} ;
14
14
15
15
describe ( 'ErrorBoundary' , ( ) => {
16
- const OLD_ENV = process . env ;
16
+ const OLD_ENV = { ... process . env } ;
17
17
let mockConsoleError : jest . SpyInstance ;
18
18
19
19
beforeEach ( ( ) => {
@@ -48,7 +48,7 @@ describe('ErrorBoundary', () => {
48
48
49
49
test ( 'should render alert message when error happened' , ( ) => {
50
50
const { queryByRole, rerender } = render ( < ComponentWithError /> , {
51
- wrapper : ErrorBoundary as ComponentType < unknown > ,
51
+ wrapper : ErrorBoundary ,
52
52
} ) ;
53
53
54
54
expect ( queryByRole ( 'alert' ) ) . not . toBeInTheDocument ( ) ;
You can’t perform that action at this time.
0 commit comments