Skip to content

Commit 44ddfd1

Browse files
committed
test: use real times for tests and fake timers only for debounce fn test
1 parent 16b8e1c commit 44ddfd1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/test/index.spec.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { computeTooltipPosition } from 'utils/compute-positions'
44
import { TooltipController as Tooltip } from '../components/TooltipController'
55

66
// Tell Jest to mock all timeout functions
7-
jest.useFakeTimers()
7+
jest.useRealTimers()
88

99
// eslint-disable-next-line react/prop-types
1010
const TooltipProps = ({ id, ...tooltipParams }) => (
@@ -208,6 +208,8 @@ describe('compute positions', () => {
208208
})
209209

210210
describe('debounce', () => {
211+
jest.useFakeTimers()
212+
211213
let func
212214
let debouncedFunc
213215

0 commit comments

Comments
 (0)