diff --git a/packages/google-cloud-speech/package.json b/packages/google-cloud-speech/package.json index 46ab8bb0cdd..b4767c7dca1 100644 --- a/packages/google-cloud-speech/package.json +++ b/packages/google-cloud-speech/package.json @@ -72,7 +72,7 @@ "prettier": "^1.13.5", "sinon": "^7.0.0", "ts-loader": "^6.2.1", - "typescript": "~3.7.0", + "typescript": "3.6.4", "webpack": "^4.41.2", "webpack-cli": "^3.3.10" } diff --git a/packages/google-cloud-speech/system-test/speech_typescript_system_test.ts b/packages/google-cloud-speech/system-test/speech_typescript_system_test.ts index 21e8c9203c6..5309d646a04 100644 --- a/packages/google-cloud-speech/system-test/speech_typescript_system_test.ts +++ b/packages/google-cloud-speech/system-test/speech_typescript_system_test.ts @@ -41,7 +41,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' ); }); @@ -69,7 +69,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' ); }); @@ -103,7 +103,7 @@ describe('SpeechClient TypeScript system test default', () => { 'data', (response: google.cloud.speech.v1.IStreamingRecognizeResponse) => { assert.strictEqual( - response?.results?.[0]?.alternatives?.[0]?.transcript, + response.results![0].alternatives![0].transcript, 'test of streaming recognize call' ); gotResponse = true; diff --git a/packages/google-cloud-speech/system-test/speech_typescript_system_test_v1.ts b/packages/google-cloud-speech/system-test/speech_typescript_system_test_v1.ts index dedc762d054..024728e4e08 100644 --- a/packages/google-cloud-speech/system-test/speech_typescript_system_test_v1.ts +++ b/packages/google-cloud-speech/system-test/speech_typescript_system_test_v1.ts @@ -41,7 +41,7 @@ describe('SpeechClient TypeScript system test v1', () => { }; const [response] = await client.recognize(request); assert.strictEqual( - response?.results?.[0]?.alternatives?.[0]?.transcript, + response.results![0]!.alternatives![0].transcript, 'hello' ); }); @@ -69,7 +69,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' ); }); @@ -103,7 +103,7 @@ describe('SpeechClient TypeScript system test v1', () => { 'data', (response: google.cloud.speech.v1.IStreamingRecognizeResponse) => { assert.strictEqual( - response?.results?.[0]?.alternatives?.[0]?.transcript, + response.results![0].alternatives![0].transcript, 'test of streaming recognize call' ); gotResponse = true; diff --git a/packages/google-cloud-speech/system-test/speech_typescript_system_test_v1p1beta1.ts b/packages/google-cloud-speech/system-test/speech_typescript_system_test_v1p1beta1.ts index 9bf94da77b5..210b4537eb7 100644 --- a/packages/google-cloud-speech/system-test/speech_typescript_system_test_v1p1beta1.ts +++ b/packages/google-cloud-speech/system-test/speech_typescript_system_test_v1p1beta1.ts @@ -41,7 +41,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' ); }); @@ -69,7 +69,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' ); }); @@ -103,7 +103,7 @@ describe('SpeechClient TypeScript system test v1p1beta1', () => { 'data', (response: google.cloud.speech.v1p1beta1.IStreamingRecognizeResponse) => { assert.strictEqual( - response?.results?.[0]?.alternatives?.[0]?.transcript, + response.results![0].alternatives![0].transcript, 'test of streaming recognize call' ); gotResponse = true;