diff --git a/system-test/speech_system_test.js b/system-test/speech_system_test.js index 157287b9..82d1dbb4 100644 --- a/system-test/speech_system_test.js +++ b/system-test/speech_system_test.js @@ -95,9 +95,9 @@ describe('SpeechClient system test default', () => { const stream = client.streamingRecognize(request); let gotResponse = false; stream.on('data', response => { - assert.strictEqual( + assert.match( response.results[0].alternatives[0].transcript, - 'test of streaming recognize call' + /test.*call/ ); gotResponse = true; }); diff --git a/system-test/speech_system_test_v1.js b/system-test/speech_system_test_v1.js index 9da3dc9a..c6ce4841 100644 --- a/system-test/speech_system_test_v1.js +++ b/system-test/speech_system_test_v1.js @@ -95,9 +95,9 @@ describe('SpeechClient system test v1', () => { const stream = client.streamingRecognize(request); let gotResponse = false; stream.on('data', response => { - assert.strictEqual( + assert.match( response.results[0].alternatives[0].transcript, - 'test of streaming recognize call' + /test.*call/ ); gotResponse = true; }); diff --git a/system-test/speech_system_test_v1p1beta1.js b/system-test/speech_system_test_v1p1beta1.js index abfe4997..6ed8e0fd 100644 --- a/system-test/speech_system_test_v1p1beta1.js +++ b/system-test/speech_system_test_v1p1beta1.js @@ -95,9 +95,9 @@ describe('SpeechClient system test v1p1beta1', () => { const stream = client.streamingRecognize(request); let gotResponse = false; stream.on('data', response => { - assert.strictEqual( + assert.match( response.results[0].alternatives[0].transcript, - 'test of streaming recognize call' + /test.*call/ ); gotResponse = true; }); diff --git a/system-test/speech_typescript_system_test.ts b/system-test/speech_typescript_system_test.ts index 49cce591..299ad3e0 100644 --- a/system-test/speech_typescript_system_test.ts +++ b/system-test/speech_typescript_system_test.ts @@ -44,7 +44,7 @@ describe('SpeechClient TypeScript system test default', () => { }; const [response] = await client.recognize(request); assert.strictEqual( - response.results![0].alternatives![0].transcript, + response.results![0].alternatives![0].transcript ?? '', 'hello' ); }); @@ -74,7 +74,7 @@ describe('SpeechClient TypeScript system test default', () => { const [operation] = await client.longRunningRecognize(request); const [response] = await operation.promise(); assert.strictEqual( - response.results![0].alternatives![0].transcript, + response.results![0].alternatives![0].transcript ?? '', 'hello' ); }); @@ -107,9 +107,9 @@ describe('SpeechClient TypeScript system test default', () => { stream.on( 'data', (response: google.cloud.speech.v1.IStreamingRecognizeResponse) => { - assert.strictEqual( - response.results![0].alternatives![0].transcript, - 'test of streaming recognize call' + assert.match( + response.results![0].alternatives![0].transcript ?? '', + /test.*call/ ); gotResponse = true; } diff --git a/system-test/speech_typescript_system_test_v1.ts b/system-test/speech_typescript_system_test_v1.ts index d84ee413..5f29c62c 100644 --- a/system-test/speech_typescript_system_test_v1.ts +++ b/system-test/speech_typescript_system_test_v1.ts @@ -74,7 +74,7 @@ describe('SpeechClient TypeScript system test v1', () => { const [operation] = await client.longRunningRecognize(request); const [response] = await operation.promise(); assert.strictEqual( - response.results![0].alternatives![0].transcript, + response.results![0].alternatives![0].transcript ?? '', 'hello' ); }); @@ -107,9 +107,9 @@ describe('SpeechClient TypeScript system test v1', () => { stream.on( 'data', (response: google.cloud.speech.v1.IStreamingRecognizeResponse) => { - assert.strictEqual( - response.results![0].alternatives![0].transcript, - 'test of streaming recognize call' + assert.match( + response.results![0].alternatives![0].transcript ?? '', + /test.*call/ ); gotResponse = true; } diff --git a/system-test/speech_typescript_system_test_v1p1beta1.ts b/system-test/speech_typescript_system_test_v1p1beta1.ts index 288e37ea..34d82e12 100644 --- a/system-test/speech_typescript_system_test_v1p1beta1.ts +++ b/system-test/speech_typescript_system_test_v1p1beta1.ts @@ -44,7 +44,7 @@ describe('SpeechClient TypeScript system test v1p1beta1', () => { }; const [response] = await client.recognize(request); assert.strictEqual( - response.results![0].alternatives![0].transcript, + response.results![0].alternatives![0].transcript ?? '', 'hello' ); }); @@ -74,7 +74,7 @@ describe('SpeechClient TypeScript system test v1p1beta1', () => { const [operation] = await client.longRunningRecognize(request); const [response] = await operation.promise(); assert.strictEqual( - response.results![0].alternatives![0].transcript, + response.results![0].alternatives![0].transcript ?? '', 'hello' ); }); @@ -107,9 +107,9 @@ describe('SpeechClient TypeScript system test v1p1beta1', () => { stream.on( 'data', (response: google.cloud.speech.v1p1beta1.IStreamingRecognizeResponse) => { - assert.strictEqual( - response.results![0].alternatives![0].transcript, - 'test of streaming recognize call' + assert.match( + response.results![0].alternatives![0].transcript ?? '', + /test.*call/ ); gotResponse = true; }