Skip to content

Commit

Permalink
test: Improve test perf for suggestion tests (#1220)
Browse files Browse the repository at this point in the history
  • Loading branch information
eps1lon authored Mar 8, 2023
1 parent 3f64545 commit fb069c9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/__tests__/suggestions.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@ beforeAll(() => {
configure({throwSuggestions: true})
})

beforeEach(() => {
// We're testing suggestions of find* queries but we're not interested in their time-related behavior.
// Real timers would make the test suite slower for no reason.
jest.useFakeTimers()
})

afterEach(() => {
jest.useRealTimers()
configure({testIdAttribute: 'data-testid', throwSuggestions: true})
console.warn.mockClear()
})
Expand Down

0 comments on commit fb069c9

Please sign in to comment.