1
0
mirror of https://github.com/SomboChea/ui synced 2026-01-17 08:35:47 +07:00

fix: improve jest mock typings

This commit is contained in:
Antoine Chalifour
2019-10-03 13:23:11 +02:00
committed by antoinechalifour
parent b1804d7644
commit 852f6eeb22
3 changed files with 3 additions and 11 deletions

View File

@@ -5,7 +5,7 @@ import Engine from './Engines';
jest.mock('./img/node.png', () => '');
jest.mock('../Install/img/npm.svg', () => '');
const mockPackageMeta = jest.fn(() => ({
const mockPackageMeta: jest.Mock = jest.fn(() => ({
latest: {
homepage: 'https://verdaccio.tld',
bugs: {
@@ -38,7 +38,6 @@ describe('<Engines /> component', () => {
},
};
// @ts-ignore
mockPackageMeta.mockImplementation(() => packageMeta);
const wrapper = mount(<Engine />);
@@ -50,7 +49,6 @@ describe('<Engines /> component', () => {
latest: {},
};
// @ts-ignore
mockPackageMeta.mockImplementation(() => packageMeta);
const wrapper = mount(<Engine />);
@@ -64,7 +62,6 @@ describe('<Engines /> component', () => {
},
};
// @ts-ignore
mockPackageMeta.mockImplementation(() => packageMeta);
const wrapper = mount(<Engine />);