You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> Note: You may need to extend jest by importing `jest-axe/extend-expect` at `test-setup.ts`
170
170
171
+
### Usage with jest.useFakeTimers() or mocking setTimeout
172
+
173
+
> thrown: "Exceeded timeout of 5000 ms for a test.
174
+
> Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test."
175
+
176
+
aXe core does not work when timers (setTimeout) are mocked. When using `jest.useFakeTimers()` aXe core will timeout often causing failing tests.
177
+
178
+
We recommend renabling the timers temporarily for aXe:
179
+
180
+
```javascript
181
+
jest.useRealTimers();
182
+
constresults=awaitaxe(wrapper.element);
183
+
jest.useFakeTimers();
184
+
```
185
+
171
186
### Axe configuration
172
187
173
188
The `axe` function allows options to be set with the [same options as documented in axe-core](https://github.com/dequelabs/axe-core/blob/master/doc/API.md#options-parameter):
0 commit comments