@@ -72,24 +72,30 @@ describe("createTelephonyTtsProvider", () => {
7272 ) ;
7373 } ) ;
7474
75- it ( "rejects unsupported container output with provider context" , async ( ) => {
76- const provider = await createTelephonyTtsProvider ( {
77- coreConfig : createCoreConfig ( ) ,
78- runtime : createRuntime ( async ( ) => ( {
79- success : true ,
80- audioBuffer : Buffer . from ( "container" ) ,
81- outputFormat : "mp3" ,
82- sampleRate : 24_000 ,
83- provider : "example-provider" ,
84- } ) ) ,
85- } ) ;
75+ it . each ( [
76+ [ "mp3" , 24_000 ] ,
77+ [ "riff-8khz-8bit-mono-mulaw" , 8_000 ] ,
78+ ] ) (
79+ "rejects unsupported %s container output with provider context" ,
80+ async ( outputFormat , sampleRate ) => {
81+ const provider = await createTelephonyTtsProvider ( {
82+ coreConfig : createCoreConfig ( ) ,
83+ runtime : createRuntime ( async ( ) => ( {
84+ success : true ,
85+ audioBuffer : Buffer . from ( "container" ) ,
86+ outputFormat,
87+ sampleRate,
88+ provider : "example-provider" ,
89+ } ) ) ,
90+ } ) ;
8691
87- const synthesis = provider . synthesizeForTelephony ( "hello" ) ;
88- await expect ( synthesis ) . rejects . toMatchObject ( {
89- name : "UnsupportedTelephonyTtsOutputFormatError" ,
90- message : 'Unsupported telephony TTS output format "mp3" from provider "example-provider"' ,
91- } ) ;
92- } ) ;
92+ const synthesis = provider . synthesizeForTelephony ( "hello" ) ;
93+ await expect ( synthesis ) . rejects . toMatchObject ( {
94+ name : "UnsupportedTelephonyTtsOutputFormatError" ,
95+ message : `Unsupported telephony TTS output format "${ outputFormat } " from provider "example-provider"` ,
96+ } ) ;
97+ } ,
98+ ) ;
9399
94100 it ( "uses shared preparation for the surface override and request text" , async ( ) => {
95101 const effectiveConfig : OpenClawConfig = {
0 commit comments