forked from testing-library/react-testing-library
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "test: Ignore React 18 legacy root deprecation warnings (testi…
…ng-library#929)" This reverts commit c1878a9.
- Loading branch information
Showing
5 changed files
with
12 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,5 @@ | ||
import '@testing-library/jest-dom/extend-expect' | ||
|
||
let consoleErrorMock | ||
|
||
beforeEach(() => { | ||
const originalConsoleError = console.error | ||
consoleErrorMock = jest | ||
.spyOn(console, 'error') | ||
.mockImplementation((message, ...optionalParams) => { | ||
// Ignore ReactDOM.render/ReactDOM.hydrate deprecation warning | ||
if (message.indexOf('Use createRoot instead.') !== -1) { | ||
return | ||
} | ||
originalConsoleError(message, ...optionalParams) | ||
}) | ||
}) | ||
|
||
afterEach(() => { | ||
consoleErrorMock.mockRestore() | ||
}) | ||
|
||
// TODO: Can be removed in a future React release: https://github.com/reactwg/react-18/discussions/23#discussioncomment-798952 | ||
// eslint-disable-next-line import/no-extraneous-dependencies -- need the version from React not an explicitly declared one | ||
jest.mock('scheduler', () => require('scheduler/unstable_mock')) |