We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7957355 commit e44adc5Copy full SHA for e44adc5
tests/setup-env.js
@@ -1 +1,21 @@
1
import '@testing-library/jest-dom/extend-expect'
2
+
3
+beforeEach(() => {
4
+ const originalConsoleError = console.error
5
+ jest
6
+ .spyOn(console, 'error')
7
+ .mockImplementation((message, ...optionalParams) => {
8
+ // Ignore ReactDOM.render/ReactDOM.hydrate deprecation warning
9
+ if (message.indexOf('Use createRoot instead.') !== -1) {
10
+ return
11
+ }
12
+ originalConsoleError(message, ...optionalParams)
13
+ })
14
+})
15
16
+afterEach(() => {
17
+ // maybe another test already restore console error mocks
18
+ if (typeof console.error.mockRestore === 'function') {
19
+ console.error.mockRestore()
20
21
0 commit comments