mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-04-21 05:56:20 +00:00
Introduce shoehorn as a possible replacement for ts-mockery
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import { Mock } from 'ts-mockery';
|
||||
import { fromPartial } from '@total-typescript/shoehorn';
|
||||
import { ErrorHandler as createErrorHandler } from '../../src/common/ErrorHandler';
|
||||
import { renderWithEvents } from '../__helpers__/setUpTest';
|
||||
|
||||
@@ -9,10 +9,10 @@ const ComponentWithError = () => {
|
||||
|
||||
describe('<ErrorHandler />', () => {
|
||||
const reload = jest.fn();
|
||||
const window = Mock.of<Window>({
|
||||
const window = fromPartial<Window>({
|
||||
location: { reload },
|
||||
});
|
||||
const cons = Mock.of<Console>({ error: jest.fn() });
|
||||
const cons = fromPartial<Console>({ error: jest.fn() });
|
||||
const ErrorHandler = createErrorHandler(window, cons);
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
Reference in New Issue
Block a user