Skip to content

Commit fb069c9

Browse files
authored
test: Improve test perf for suggestion tests (#1220)
1 parent 3f64545 commit fb069c9

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Diff for: src/__tests__/suggestions.js

+7
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,14 @@ beforeAll(() => {
66
configure({throwSuggestions: true})
77
})
88

9+
beforeEach(() => {
10+
// We're testing suggestions of find* queries but we're not interested in their time-related behavior.
11+
// Real timers would make the test suite slower for no reason.
12+
jest.useFakeTimers()
13+
})
14+
915
afterEach(() => {
16+
jest.useRealTimers()
1017
configure({testIdAttribute: 'data-testid', throwSuggestions: true})
1118
console.warn.mockClear()
1219
})

0 commit comments

Comments
 (0)