File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -26,7 +26,8 @@ const storage = require('@google-cloud/storage')();
2626// Get a reference to the Cloud Vision API component
2727const vision = require ( '@google-cloud/vision' ) ( ) ;
2828// Get a reference to the Translate API component
29- const translate = require ( '@google-cloud/translate' ) ( ) ;
29+ const { Translate} = require ( '@google-cloud/translate' ) ;
30+ const translate = new Translate ( ) ;
3031
3132const Buffer = require ( 'safe-buffer' ) . Buffer ;
3233// [END functions_ocr_setup]
Original file line number Diff line number Diff line change 1717 "dependencies" : {
1818 "@google-cloud/pubsub" : " 0.22.2" ,
1919 "@google-cloud/storage" : " 1.7.0" ,
20- "@google-cloud/translate" : " 1.0.0 " ,
20+ "@google-cloud/translate" : " 2.1.3 " ,
2121 "@google-cloud/vision" : " 0.23.0" ,
2222 "safe-buffer" : " 5.1.2"
2323 },
Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ function getSample() {
6868
6969 return {
7070 program : proxyquire ( `../` , {
71- '@google-cloud/translate' : TranslateMock ,
71+ '@google-cloud/translate' : { Translate : TranslateMock } ,
7272 '@google-cloud/vision' : VisionMock ,
7373 '@google-cloud/pubsub' : { PubSub : PubsubMock } ,
7474 '@google-cloud/storage' : StorageMock ,
You can’t perform that action at this time.
0 commit comments