Introduce shoehorn as a possible replacement for ts-mockery

This commit is contained in:
Alejandro Celaya 2023-04-13 21:48:29 +02:00
parent f6334c3618
commit 340f4b8fb5
65 changed files with 357 additions and 375 deletions
test/servers/helpers

View file

@ -1,6 +1,6 @@
import { render, screen } from '@testing-library/react';
import { fromPartial } from '@total-typescript/shoehorn';
import { MemoryRouter } from 'react-router-dom';
import { Mock } from 'ts-mockery';
import type { NonReachableServer, NotFoundServer } from '../../../src/servers/data';
import { ServerError as createServerError } from '../../../src/servers/helpers/ServerError';
@ -9,7 +9,7 @@ describe('<ServerError />', () => {
it.each([
[
Mock.all<NotFoundServer>(),
fromPartial<NotFoundServer>({}),
{
found: ['Could not find this Shlink server.'],
notFound: [
@ -20,7 +20,7 @@ describe('<ServerError />', () => {
},
],
[
Mock.of<NonReachableServer>({ id: 'abc123' }),
fromPartial<NonReachableServer>({ id: 'abc123' }),
{
found: [
'Oops! Could not connect to this Shlink server.',