Update @types/jest package and remove ts-ignore for getTimerCount

This commit is contained in:
Mario Beltrán Alarcón 2019-08-05 22:23:11 +02:00
parent 6b78160553
commit cecd1adcfa
4 changed files with 5 additions and 9 deletions

View File

@ -73,7 +73,7 @@
"@storybook/addon-options": "5.1.10",
"@storybook/react": "5.1.10",
"@testing-library/react-hooks": "^1.1.0",
"@types/jest": "24.0.16",
"@types/jest": "24.0.17",
"@types/react": "16.8.23",
"babel-core": "6.26.3",
"babel-loader": "8.0.6",

View File

@ -148,13 +148,11 @@ it('should clear pending timers on unmount', () => {
const stopSpy = jest.spyOn(global, 'cancelAnimationFrame' as any);
const { unmount } = renderHook(() => useRaf());
// @ts-ignore getTimerCount is not defined on jest types
expect(jest.getTimerCount()).toBe(1);
expect(stopSpy).not.toHaveBeenCalled();
unmount();
// @ts-ignore getTimerCount is not defined on jest types
expect(jest.getTimerCount()).toBe(0);
expect(stopSpy).toHaveBeenCalledTimes(1);
});

View File

@ -76,10 +76,8 @@ it('should always return ready as true after custom timeout reached', () => {
it('should clear pending timer on unmount', () => {
const { unmount } = renderHook(() => useTimeout());
// @ts-ignore getTimerCount is not defined on jest types
expect(jest.getTimerCount()).toBe(1);
unmount();
// @ts-ignore getTimerCount is not defined on jest types
expect(jest.getTimerCount()).toBe(0);
});

View File

@ -2728,10 +2728,10 @@
resolved "https://registry.yarnpkg.com/@types/jest-diff/-/jest-diff-20.0.1.tgz#35cc15b9c4f30a18ef21852e255fdb02f6d59b89"
integrity sha512-yALhelO3i0hqZwhjtcr6dYyaLoCHbAMshwtj6cGxTvHZAKXHsYGdff6E8EPw3xLKY0ELUTQ69Q1rQiJENnccMA==
"@types/jest@24.0.16":
version "24.0.16"
resolved "https://registry.yarnpkg.com/@types/jest/-/jest-24.0.16.tgz#8d3e406ec0f0dc1688d6711af3062ff9bd428066"
integrity sha512-JrAiyV+PPGKZzw6uxbI761cHZ0G7QMOHXPhtSpcl08rZH6CswXaaejckn3goFKmF7M3nzEoJ0lwYCbqLMmjziQ==
"@types/jest@24.0.17":
version "24.0.17"
resolved "https://registry.yarnpkg.com/@types/jest/-/jest-24.0.17.tgz#b66ea026efb746eb5db1356ee28518aaff7af416"
integrity sha512-1cy3xkOAfSYn78dsBWy4M3h/QF/HeWPchNFDjysVtp3GHeTdSmtluNnELfCmfNRRHo0OWEcpf+NsEJQvwQfdqQ==
dependencies:
"@types/jest-diff" "*"