diff --git a/packages/hooks/src/useCountDown/__tests__/index.test.ts b/packages/hooks/src/useCountDown/__tests__/index.test.ts index 8fbd248090..21b118c3fc 100644 --- a/packages/hooks/src/useCountDown/__tests__/index.test.ts +++ b/packages/hooks/src/useCountDown/__tests__/index.test.ts @@ -4,11 +4,11 @@ import useCountDown, { TDate, Options } from '../index'; // https://github.com/facebook/jest/issues/2234 jest.spyOn(Date, 'now').mockImplementation(() => 1479427200000); -const init = (_targetDate?: TDate, _interval?: Options['intervalTime']) => - renderHook(({ targetDate, intervalTime }) => useCountDown({ targetDate, intervalTime }), { +const init = (_targetDate?: TDate, _interval?: Options['interval']) => + renderHook(({ targetDate, interval }) => useCountDown({ targetDate, interval }), { initialProps: { targetDate: _targetDate, - intervalTime: _interval, + interval: _interval, }, }); diff --git a/packages/hooks/src/useCountDown/demo/demo2.tsx b/packages/hooks/src/useCountDown/demo/demo2.tsx index 4b5aa4dcb7..dda707df5b 100644 --- a/packages/hooks/src/useCountDown/demo/demo2.tsx +++ b/packages/hooks/src/useCountDown/demo/demo2.tsx @@ -20,7 +20,7 @@ export default () => { }} disabled={countdown !== 0} > - {countdown === 0 ? 'Start Interval' : `Reset After ${Math.ceil(countdown / 1000)}s`} + {countdown === 0 ? 'Start Interval' : `Reset After ${Math.round(countdown / 1000)}s`}