Normalized mocks

This commit is contained in:
Alejandro Celaya
2022-07-16 10:52:45 +02:00
parent 491b2f2c07
commit 4c7bed90a3
7 changed files with 41 additions and 22 deletions

View File

@@ -0,0 +1,18 @@
import { Mock } from 'ts-mockery';
const createLinkMock = () => ({
setAttribute: jest.fn(),
click: jest.fn(),
style: {},
});
export const appendChild = jest.fn();
export const removeChild = jest.fn();
export const windowMock = Mock.of<Window>({
document: {
createElement: jest.fn(createLinkMock),
body: { appendChild, removeChild },
},
});