-
Notifications
You must be signed in to change notification settings - Fork 38
/
setupTests.js
42 lines (38 loc) · 847 Bytes
/
setupTests.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// jest-dom adds custom jest matchers for asserting on DOM nodes.
// allows you to do things like:
// expect(element).toHaveTextContent(/react/i)
// learn more: https://github.com/testing-library/jest-dom
import '@testing-library/jest-dom/extend-expect'
import { toHaveNoViolations } from 'jest-axe'
// make globally available for all tests
expect.extend(toHaveNoViolations)
// required since it uses `document.createRange`
jest.mock(
'popper.js',
() =>
class Popper {
static placements = [
'auto',
'auto-end',
'auto-start',
'bottom',
'bottom-end',
'bottom-start',
'left',
'left-end',
'left-start',
'right',
'right-end',
'right-start',
'top',
'top-end',
'top-start',
]
constructor() {
return {
destroy: () => {},
scheduleUpdate: () => {},
}
}
}
)