Created
April 13, 2023 17:37
-
-
Save Lokua/94f2a5f89f4385c8f0156d7950535b22 to your computer and use it in GitHub Desktop.
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
const originalError = console.error | |
beforeAll(() => { | |
jest.spyOn(console, 'error').mockImplementation((...args) => { | |
if ( | |
typeof args[0] === 'string' && | |
args[0].includes('inside a test was not wrapped in act') | |
) { | |
return | |
} | |
return originalError(...args) | |
}) | |
}) | |
afterAll(() => { | |
console.error.mockRestore() | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment