Skip to content

Commit eb00c92

Browse files
Copilotmorganney
andcommitted
Fix TypeScript lint error in test file for render prop mock
Co-authored-by: morganney <[email protected]>
1 parent 254c9cf commit eb00c92

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/tts-react/__tests__/hook.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { renderHook, act, waitFor } from '@testing-library/react'
44
import { SpeechSynthesisMock } from './speechSynthesis.mock.js'
55
import { SpeechSynthesisEventMock } from './speechSynthesisEvent.mock.js'
66
import { useTts } from '../src/hook.js'
7+
import type { TTSRenderProp } from '../src/hook.js'
78
import { stripPunctuation } from '../src/utils.js'
89
import './setup.js'
910

@@ -355,7 +356,7 @@ describe('useTts', () => {
355356

356357
it('supports render prop for custom highlighting', async () => {
357358
const testText = 'Test text for highlighting'
358-
const mockRender = jest.fn((params) => params.children)
359+
const mockRender = jest.fn<ReturnType<TTSRenderProp>, Parameters<TTSRenderProp>>((params: Parameters<TTSRenderProp>[0]) => params.children)
359360

360361
const { result } = renderHook(
361362
({ text, render, markTextAsSpoken }) => useTts({ text, render, markTextAsSpoken }),

0 commit comments

Comments
 (0)