@@ -153,10 +153,7 @@ describe('Request/Response lifecycle mocking', () => {
153153 } ) ;
154154
155155 beforeEach ( ( ) => {
156- env
157- . setProjectId ( )
158- . setKeyFilename ( )
159- . setProduction ( ) ;
156+ env . setProjectId ( ) . setKeyFilename ( ) . setProduction ( ) ;
160157 fakeService = nock (
161158 'https://clouderrorreporting.googleapis.com/v1beta1/projects/' +
162159 process . env . GCLOUD_PROJECT
@@ -179,7 +176,7 @@ describe('Request/Response lifecycle mocking', () => {
179176 env . restoreProcessToOriginalState ( ) ;
180177 } ) ;
181178
182- it ( 'Should fail when receiving non-retryable errors' , function ( this , done ) {
179+ it ( 'Should fail when receiving non-retryable errors' , function ( this , done ) {
183180 this . timeout ( 5000 ) ;
184181 client . sendError ( { } as ErrorMessage , ( err , response ) => {
185182 assert ( err instanceof Error ) ;
@@ -193,7 +190,7 @@ describe('Request/Response lifecycle mocking', () => {
193190 } ) ;
194191 } ) ;
195192
196- it ( 'Should retry when receiving retryable errors' , function ( this , done ) {
193+ it ( 'Should retry when receiving retryable errors' , function ( this , done ) {
197194 this . timeout ( 25000 ) ;
198195 let tries = 0 ;
199196 const intendedTries = 4 ;
@@ -212,10 +209,7 @@ describe('Request/Response lifecycle mocking', () => {
212209 'Should provide the key as a query string on outgoing requests when ' +
213210 'using an API key' ,
214211 done => {
215- env
216- . sterilizeProcess ( )
217- . setProjectId ( )
218- . setProduction ( ) ;
212+ env . sterilizeProcess ( ) . setProjectId ( ) . setProduction ( ) ;
219213 const key = env . apiKey ;
220214 const logger = createLogger ( { logLevel : 5 } ) ;
221215 const client = new RequestHandler (
@@ -256,7 +250,7 @@ describe('Client creation', () => {
256250 it (
257251 'Should not throw on initialization when using only project id as a ' +
258252 'runtime argument' ,
259- function ( this , done ) {
253+ function ( this , done ) {
260254 env . sterilizeProcess ( ) . setKeyFilename ( ) ;
261255 const logger = createLogger ( { logLevel : 5 } ) ;
262256 const cfg = new Configuration (
@@ -284,11 +278,8 @@ describe('Client creation', () => {
284278 it (
285279 'Should not throw on initialization when using only project id as an ' +
286280 'env variable' ,
287- function ( this , done ) {
288- env
289- . sterilizeProcess ( )
290- . setProjectId ( )
291- . setKeyFilename ( ) ;
281+ function ( this , done ) {
282+ env . sterilizeProcess ( ) . setProjectId ( ) . setKeyFilename ( ) ;
292283 const logger = createLogger ( { logLevel : 5 } ) ;
293284 const cfg = new Configuration ( { reportMode : 'always' } , logger ) ;
294285 this . timeout ( 10000 ) ;
@@ -309,7 +300,7 @@ describe('Client creation', () => {
309300 it (
310301 'Should not throw on initialization when using only project number as ' +
311302 'a runtime argument' ,
312- function ( this , done ) {
303+ function ( this , done ) {
313304 env . sterilizeProcess ( ) . setKeyFilename ( ) ;
314305 const logger = createLogger ( { logLevel : 5 } ) ;
315306 const cfg = new Configuration (
@@ -337,11 +328,8 @@ describe('Client creation', () => {
337328 it (
338329 'Should not throw on initialization when using only project number as ' +
339330 'an env variable' ,
340- function ( this , done ) {
341- env
342- . sterilizeProcess ( )
343- . setKeyFilename ( )
344- . setProjectNumber ( ) ;
331+ function ( this , done ) {
332+ env . sterilizeProcess ( ) . setKeyFilename ( ) . setProjectNumber ( ) ;
345333 const logger = createLogger ( { logLevel : 5 } ) ;
346334 const cfg = new Configuration ( { reportMode : 'always' } , logger ) ;
347335 this . timeout ( 10000 ) ;
@@ -376,10 +364,7 @@ describe('Expected Behavior', () => {
376364 } ) ;
377365
378366 it ( 'Should callback with an error with a configuration that cannot report errors' , done => {
379- env
380- . sterilizeProcess ( )
381- . setKeyFilename ( )
382- . setProjectId ( ) ;
367+ env . sterilizeProcess ( ) . setKeyFilename ( ) . setProjectId ( ) ;
383368 process . env . NODE_ENV = 'null' ;
384369 const logger = createLogger ( { logLevel : 5 , reportMode : 'production' } ) ;
385370 const client = new RequestHandler (
@@ -461,7 +446,8 @@ describe('error-reporting', () => {
461446 // interfering with existing listeners of the 'unhandledRejection' event.
462447 assert . strictEqual ( process . listenerCount ( 'unhandledRejection' ) , 0 ) ;
463448 oldLogger = console . error ;
464- console . error = function ( this , ...args : any [ ] ) {
449+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
450+ console . error = function ( this , ...args : any [ ] ) {
465451 const text = util . format ( null , args ) ;
466452 oldLogger ( text ) ;
467453 logOutput += text ;
@@ -579,15 +565,16 @@ describe('error-reporting', () => {
579565 const context = rep . serviceContext ;
580566 assert . ok (
581567 context ,
582- ` Expected the error item's representative to have a context`
568+ " Expected the error item's representative to have a context"
583569 ) ;
584570 assert . strictEqual ( context . service , SERVICE ) ;
585571 assert . strictEqual ( context . version , VERSION ) ;
586572 }
587573
588574 // the `errOb` argument can be anything, including `null` and `undefined`
589575 async function verifyReporting (
590- errOb : any , // tslint:disable-line:no-any
576+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
577+ errOb : any ,
591578 messageTest : ( message : string ) => void ,
592579 maxCount : number ,
593580 timeout : number
@@ -638,7 +625,7 @@ describe('error-reporting', () => {
638625 ) ;
639626 } ) ;
640627
641- it ( 'Should correctly publish an error that is a string' , async function ( this ) {
628+ it ( 'Should correctly publish an error that is a string' , async function ( this ) {
642629 this . timeout ( TIMEOUT ) ;
643630 const errorId = buildName ( 'with-string' ) ;
644631 await verifyReporting (
@@ -651,7 +638,7 @@ describe('error-reporting', () => {
651638 ) ;
652639 } ) ;
653640
654- it ( 'Should correctly publish an error that is undefined' , async function ( this ) {
641+ it ( 'Should correctly publish an error that is undefined' , async function ( this ) {
655642 this . timeout ( TIMEOUT ) ;
656643 await verifyReporting (
657644 undefined ,
@@ -663,7 +650,7 @@ describe('error-reporting', () => {
663650 ) ;
664651 } ) ;
665652
666- it ( 'Should correctly publish an error that is null' , async function ( this ) {
653+ it ( 'Should correctly publish an error that is null' , async function ( this ) {
667654 this . timeout ( TIMEOUT ) ;
668655 await verifyReporting (
669656 null ,
@@ -675,7 +662,7 @@ describe('error-reporting', () => {
675662 ) ;
676663 } ) ;
677664
678- it ( 'Should correctly publish an error that is a plain object' , async function ( this ) {
665+ it ( 'Should correctly publish an error that is a plain object' , async function ( this ) {
679666 this . timeout ( TIMEOUT ) ;
680667 await verifyReporting (
681668 { someKey : 'someValue' } ,
@@ -687,7 +674,7 @@ describe('error-reporting', () => {
687674 ) ;
688675 } ) ;
689676
690- it ( 'Should correctly publish an error that is a number' , async function ( this ) {
677+ it ( 'Should correctly publish an error that is a number' , async function ( this ) {
691678 this . timeout ( TIMEOUT ) ;
692679 const num = new Date ( ) . getTime ( ) ;
693680 await verifyReporting (
@@ -700,7 +687,7 @@ describe('error-reporting', () => {
700687 ) ;
701688 } ) ;
702689
703- it ( 'Should correctly publish an error that is of an unknown type' , async function ( this ) {
690+ it ( 'Should correctly publish an error that is of an unknown type' , async function ( this ) {
704691 this . timeout ( TIMEOUT ) ;
705692 const bool = true ;
706693 await verifyReporting (
@@ -713,7 +700,7 @@ describe('error-reporting', () => {
713700 ) ;
714701 } ) ;
715702
716- it ( 'Should correctly publish errors using an error builder' , async function ( this ) {
703+ it ( 'Should correctly publish errors using an error builder' , async function ( this ) {
717704 this . timeout ( TIMEOUT ) ;
718705 const errorId = buildName ( 'with-error-builder' ) ;
719706 // Use an IIFE with the name `definitionSiteFunction` to use later to
@@ -749,7 +736,7 @@ describe('error-reporting', () => {
749736 await callingSiteFunction ( ) ;
750737 } ) ;
751738
752- it ( 'Should report unhandledRejections if enabled' , async function ( this ) {
739+ it ( 'Should report unhandledRejections if enabled' , async function ( this ) {
753740 this . timeout ( TIMEOUT ) ;
754741 reinitialize ( { reportUnhandledRejections : true } ) ;
755742 const rejectValue = buildName ( 'report-promise-rejection' ) ;
@@ -772,7 +759,7 @@ describe('error-reporting', () => {
772759 assert . notStrictEqual ( logOutput . indexOf ( expected ) , - 1 ) ;
773760 } ) ;
774761
775- it ( 'Should not report unhandledRejections if disabled' , async function ( this ) {
762+ it ( 'Should not report unhandledRejections if disabled' , async function ( this ) {
776763 this . timeout ( TIMEOUT ) ;
777764 reinitialize ( { reportUnhandledRejections : false } ) ;
778765 const rejectValue = buildName ( 'do-not-report-promise-rejection' ) ;
0 commit comments