This repository was archived by the owner on Jul 20, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +17
-7
lines changed Expand file tree Collapse file tree 3 files changed +17
-7
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ const files = [
3939 `city.jpg` ,
4040 'pdf-ocr.pdf' ,
4141 'duck_and_truck.jpg' ,
42+ 'google.png' ,
4243] . map ( name => {
4344 return {
4445 name,
@@ -114,17 +115,17 @@ describe(`detect`, () => {
114115 } ) ;
115116
116117 it ( `should detect logos in a local file` , async ( ) => {
117- const output = await exec ( `${ cmd } logos ${ files [ 2 ] . localPath } ` ) ;
118+ const output = await exec ( `${ cmd } logos ${ files [ 9 ] . localPath } ` ) ;
118119 assert . match ( output , / L o g o s : / ) ;
119- assert . match ( output , / G o o g l e / ) ;
120+ assert . match ( output , / g o o g l e / ) ;
120121 } ) ;
121122
122123 it ( `should detect logos in a remote file` , async ( ) => {
123124 const output = await exec (
124- `${ cmd } logos-gcs ${ bucketName } ${ files [ 2 ] . name } `
125+ `${ cmd } logos-gcs ${ bucketName } ${ files [ 9 ] . name } `
125126 ) ;
126127 assert . match ( output , / L o g o s : / ) ;
127- assert . match ( output , / G o o g l e / ) ;
128+ assert . match ( output , / g o o g l e / ) ;
128129 } ) ;
129130
130131 it ( `should detect properties in a local file` , async ( ) => {
Original file line number Diff line number Diff line change @@ -66,22 +66,31 @@ describe('Vision', function() {
6666 'https://upload.wikimedia.org/wikipedia/commons/5/51/Google.png' ;
6767 return client . logoDetection ( url ) . then ( responses => {
6868 const response = responses [ 0 ] ;
69- assert . deepStrictEqual ( response . logoAnnotations [ 0 ] . description , 'Google' ) ;
69+ assert . strictEqual (
70+ response . logoAnnotations [ 0 ] . description . toLowerCase ( ) ,
71+ 'google'
72+ ) ;
7073 } ) ;
7174 } ) ;
7275
7376 it ( 'should detect from a filename' , ( ) => {
7477 return client . logoDetection ( IMAGES . logo ) . then ( responses => {
7578 const response = responses [ 0 ] ;
76- assert . deepStrictEqual ( response . logoAnnotations [ 0 ] . description , 'Google' ) ;
79+ assert . deepStrictEqual (
80+ response . logoAnnotations [ 0 ] . description . toLowerCase ( ) ,
81+ 'google'
82+ ) ;
7783 } ) ;
7884 } ) ;
7985
8086 it ( 'should detect from a Buffer' , ( ) => {
8187 const buffer = fs . readFileSync ( IMAGES . logo ) ;
8288 return client . logoDetection ( buffer ) . then ( responses => {
8389 const response = responses [ 0 ] ;
84- assert . deepStrictEqual ( response . logoAnnotations [ 0 ] . description , 'Google' ) ;
90+ assert . deepStrictEqual (
91+ response . logoAnnotations [ 0 ] . description . toLowerCase ( ) ,
92+ 'google'
93+ ) ;
8594 } ) ;
8695 } ) ;
8796
You can’t perform that action at this time.
0 commit comments