-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathjest.setup.js
More file actions
22 lines (18 loc) · 604 Bytes
/
jest.setup.js
File metadata and controls
22 lines (18 loc) · 604 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import '@testing-library/jest-dom/extend-expect'
/**
* This is just a little hack to silence a warning that we'll get until react fixes this
* @see https://github.com/async-library/react-async/blob/4b6be365c5b007180636e28da2eae6b53768b431/jest.setup.js#L4
* @see https://github.com/facebook/react/pull/14853
*/
const originalError = console.error
beforeAll(() => {
console.error = (...args) => {
if (/Warning.*not wrapped in act/.test(args[0])) {
return
}
originalError.call(console, ...args)
}
})
afterAll(() => {
console.error = originalError
})