33const authHelper = require ( '../resources/auth_helper.js' ) ;
44const auth = authHelper . auth ;
55const describe = authHelper . describe ; // this runs describe.skip if there is no auth.js file :)
6- const watson = require ( '../../index ' ) ;
6+ const SpeechToTextV1 = require ( '../../speech-to-text/v1 ' ) ;
77const fs = require ( 'fs' ) ;
88const concat = require ( 'concat-stream' ) ;
99const path = require ( 'path' ) ;
@@ -15,8 +15,8 @@ const TWO_MINUTES = 2 * 60 * 1000;
1515describe ( 'speech_to_text_integration' , function ( ) {
1616 jest . setTimeout ( TWENTY_SECONDS ) ;
1717
18- const speech_to_text = new watson . SpeechToTextV1 ( auth . speech_to_text ) ;
19- const speech_to_text_rc = new watson . SpeechToTextV1 ( auth . speech_to_text_rc ) ;
18+ const speech_to_text = new SpeechToTextV1 ( auth . speech_to_text ) ;
19+ const speech_to_text_rc = new SpeechToTextV1 ( auth . speech_to_text_rc ) ;
2020
2121 it ( 'recognize() (RC) @slow' , function ( done ) {
2222 const params = {
@@ -120,7 +120,7 @@ describe('speech_to_text_integration', function() {
120120 it ( 'transcribes audio over a websocket, credentials from environment' , function ( done ) {
121121 process . env . SPEECH_TO_TEXT_IAM_APIKEY = auth . speech_to_text_rc . iam_apikey ;
122122 process . env . SPEECH_TO_TEXT_URL = auth . speech_to_text_rc . url ;
123- const speech_to_text_env = new watson . SpeechToTextV1 ( { } ) ;
123+ const speech_to_text_env = new SpeechToTextV1 ( { } ) ;
124124 const recognizeStream = speech_to_text_env . recognizeUsingWebSocket ( ) ;
125125 recognizeStream . setEncoding ( 'utf8' ) ;
126126 fs . createReadStream ( path . join ( __dirname , '../resources/weather.flac' ) )
@@ -148,7 +148,7 @@ describe('speech_to_text_integration', function() {
148148 } ,
149149 ] ,
150150 } ) ;
151- const speech_to_text_vcap = new watson . SpeechToTextV1 ( { } ) ;
151+ const speech_to_text_vcap = new SpeechToTextV1 ( { } ) ;
152152 const recognizeStream = speech_to_text_vcap . recognizeUsingWebSocket ( ) ;
153153 recognizeStream . setEncoding ( 'utf8' ) ;
154154 fs . createReadStream ( path . join ( __dirname , '../resources/weather.flac' ) )
@@ -229,7 +229,7 @@ describe('speech_to_text_integration', function() {
229229 speech_to_text . whenCustomizationReady (
230230 { customization_id : customization_id , interval : 250 , times : 400 } ,
231231 function ( err ) {
232- if ( err && err . code !== watson . SpeechToTextV1 . ERR_NO_CORPORA ) {
232+ if ( err && err . code !== SpeechToTextV1 . ERR_NO_CORPORA ) {
233233 return done ( err ) ;
234234 }
235235 test ( done ) ;
@@ -239,7 +239,7 @@ describe('speech_to_text_integration', function() {
239239 }
240240
241241 beforeAll ( function ( done ) {
242- const speech_to_text = new watson . SpeechToTextV1 ( auth . speech_to_text ) ;
242+ const speech_to_text = new SpeechToTextV1 ( auth . speech_to_text ) ;
243243 speech_to_text . listLanguageModels ( { } , function ( err , result ) {
244244 if ( err ) {
245245 // eslint-disable-next-line no-console
0 commit comments