mirror of
https://github.com/moeru-ai/airi.git
synced 2026-08-14 08:52:42 +00:00
29 lines
869 B
TypeScript
29 lines
869 B
TypeScript
import type { AudioInputObservations } from './types'
|
||
|
||
import { describe, it } from 'vitest'
|
||
|
||
import { expect, installAudioInputMatchers } from './expect-extend'
|
||
|
||
installAudioInputMatchers()
|
||
|
||
describe('audio input matchers', () => {
|
||
it('normalizes transcription case, width, punctuation, and whitespace', async () => {
|
||
const session = createAudioInputSession(['Please, SAY hello!'])
|
||
|
||
await expect(session).toHaveTranscriptions([
|
||
['please say hello'],
|
||
])
|
||
})
|
||
})
|
||
|
||
function createAudioInputSession(transcriptions: string[]): AudioInputObservations {
|
||
return {
|
||
capturedTranscriptionAudio: async () => [],
|
||
streamingTranscriptionUpdates: async () => [],
|
||
transcriptionResults: async () => transcriptions,
|
||
completedSpans: async () => [],
|
||
waitForStreamingTranscriptionReady: async () => {},
|
||
waitForVadReady: async () => {},
|
||
}
|
||
}
|