File tree Expand file tree Collapse file tree 3 files changed +14
-3
lines changed Expand file tree Collapse file tree 3 files changed +14
-3
lines changed Original file line number Diff line number Diff line change
1
+ I exist!
Original file line number Diff line number Diff line change 4
4
* @param {!express:Request } req HTTP request context.
5
5
* @param {!express:Response } res HTTP response context.
6
6
*/
7
+
8
+ let fs = require ( 'fs' ) ;
9
+
7
10
exports . helloWorld = ( req , res ) => {
11
+ // Still send a 200 so we get the response (gaxios and other libraries barf on
12
+ // non-200)
13
+ if ( ! fs . existsSync ( '.dotfile' ) ) {
14
+ res . status ( 200 ) . send ( 'Dotfile does not exist!' ) ;
15
+ return ;
16
+ }
17
+
8
18
let message = req . query . message || req . body . message || 'Hello World!!' ;
9
19
res . status ( 200 ) . send ( message ) ;
10
20
} ;
Original file line number Diff line number Diff line change @@ -421,7 +421,7 @@ describe('Zip', function () {
421
421
const filesInsideZip = await getFilesInZip ( zf ) ;
422
422
const expectedFiles = getNonIgnoredFiles ( testDirNoIgnore , testDirNoIgnore ) ;
423
423
424
- expect ( await filesInsideZip . length ) . equal ( expectedFiles . length ) ;
424
+ expect ( filesInsideZip ) . eql ( expectedFiles ) ;
425
425
filesInsideZip . forEach ( ( f ) => expect ( expectedFiles ) . to . include ( f ) ) ;
426
426
} ) ;
427
427
@@ -437,7 +437,7 @@ describe('Zip', function () {
437
437
new Set ( [ 'ignore.txt' , '.gcloudignore' ] ) ,
438
438
) ;
439
439
440
- expect ( await filesInsideZip . length ) . equal ( expectedFiles . length ) ;
440
+ expect ( filesInsideZip ) . eql ( expectedFiles ) ;
441
441
filesInsideZip . forEach ( ( f ) => expect ( expectedFiles ) . to . include ( f ) ) ;
442
442
} ) ;
443
443
@@ -453,7 +453,7 @@ describe('Zip', function () {
453
453
new Set ( [ 'bar/bar.txt' , 'bar/baz/baz.txt' ] ) ,
454
454
) ;
455
455
456
- expect ( await filesInsideZip . length ) . equal ( expectedFiles . length ) ;
456
+ expect ( filesInsideZip ) . eql ( expectedFiles ) ;
457
457
filesInsideZip . forEach ( ( f ) => expect ( expectedFiles ) . to . include ( f ) ) ;
458
458
} ) ;
459
459
} ) ;
You can’t perform that action at this time.
0 commit comments