1515 */
1616
1717import * as assert from 'assert' ;
18+ import { GCPEnv } from 'google-auth-library' ;
1819import * as proxyquire from 'proxyquire' ;
1920
20- // FIXME(ofrobots): use a proper export once the following is released:
21- // https://github.com/googleapis/google-auth-library-nodejs/pull/569.
22- import envDetect = require( 'google-auth-library/build/src/auth/envDetect' ) ;
23-
2421// types-only import. Actual require is done through proxyquire below.
2522import { MiddlewareOptions } from '../../src/middleware/express' ;
2623
@@ -116,15 +113,14 @@ describe('middleware/express', () => {
116113 assert . strictEqual ( passedProjectId , FAKE_PROJECT_ID ) ;
117114 } ) ;
118115
119- [ envDetect . GCPEnv . APP_ENGINE , envDetect . GCPEnv . CLOUD_FUNCTIONS ] . forEach (
120- env => {
121- it ( `should not generate the request logger on ${ env } ` , async ( ) => {
122- authEnvironment = env ;
123- await middleware ( ) ;
124- assert . ok ( passedOptions ) ;
125- assert . strictEqual ( passedOptions . length , 1 ) ;
126- // emitRequestLog parameter to makeChildLogger should be undefined.
127- assert . strictEqual ( passedEmitRequestLog , undefined ) ;
128- } ) ;
129- } ) ;
116+ [ GCPEnv . APP_ENGINE , GCPEnv . CLOUD_FUNCTIONS ] . forEach ( env => {
117+ it ( `should not generate the request logger on ${ env } ` , async ( ) => {
118+ authEnvironment = env ;
119+ await middleware ( ) ;
120+ assert . ok ( passedOptions ) ;
121+ assert . strictEqual ( passedOptions . length , 1 ) ;
122+ // emitRequestLog parameter to makeChildLogger should be undefined.
123+ assert . strictEqual ( passedEmitRequestLog , undefined ) ;
124+ } ) ;
125+ } ) ;
130126} ) ;
0 commit comments