Skip to content

Commit

Permalink
Ignore type errors for mocks
Browse files Browse the repository at this point in the history
  • Loading branch information
mmalfertheiner committed Mar 27, 2024
1 parent c7fa2cb commit 49ad912
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .githooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
set -e
set -o pipefail

# npm run checks
npm run checks
13 changes: 7 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"devDependencies": {
"@aboutbits/eslint-config": "^2.2.4",
"@aboutbits/prettier-config": "^1.6.1",
"@aboutbits/react-pagination": "^3.0.11",
"@aboutbits/react-pagination": "git+ssh://[email protected]:aboutbits/react-pagination.git#991eb51a8d51f8556caf940f97ef2b6b996ac427",
"@aboutbits/ts-config": "^1.1.3",
"@hookform/resolvers": "^3.3.4",
"@storybook/addon-essentials": "^7.4.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { AsyncView } from '@aboutbits/react-toolbox'
import { ReactElement, ReactNode } from 'react'
import { FormProvider, useForm } from 'react-hook-form'
import { IndexType } from '@aboutbits/pagination'
import { useQueryAndPagination } from '@aboutbits/react-pagination/dist/cjs/routers/inMemory'
import { useQueryAndPagination } from '@aboutbits/react-pagination/dist/routers/inMemory'
import { useInternationalization, useTheme } from '../../../framework'
import {
Dialog,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ describe('useHandleSubmit', () => {

const onSuccess = vi.fn(() => undefined)
const { result } = renderHook(() =>
// @ts-expect-error The mock function has not the right type
useHandleSubmit(form.current, submitAction, { onSuccess }),
)

Expand Down Expand Up @@ -138,7 +139,9 @@ describe('useHandleSubmit', () => {
const onError = vi.fn(() => undefined)
const { result } = renderHook(() =>
useHandleSubmit(form.current, onDeleteWithErrorResponse, {
// @ts-expect-error The mock function has not the right type
onSuccess,
// @ts-expect-error The mock function has not the right type
onError,
}),
)
Expand Down

0 comments on commit 49ad912

Please sign in to comment.