Skip to content

Commit

Permalink
Improve test coverage
Browse files Browse the repository at this point in the history
JamesBrill committed Feb 21, 2021
1 parent 353d853 commit 1e2fc39
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/SpeechRecognition.test.js
Original file line number Diff line number Diff line change
@@ -114,11 +114,14 @@ describe('SpeechRecognition', () => {
expect(finalTranscript).toEqual('')
})

test('ignores speech when listening is aborted', () => {
test('ignores speech when listening is aborted', async () => {
mockRecognitionManager()
const { result } = renderHook(() => useSpeechRecognition())
const speech = 'This is a test'

await act(async () => {
await SpeechRecognition.startListening()
})
act(() => {
SpeechRecognition.abortListening()
})

0 comments on commit 1e2fc39

Please sign in to comment.