@@ -87,6 +87,7 @@ function createDummyTrace(numSpans: number): Trace {
8787describe ( 'Trace Writer' , ( ) => {
8888 const pjson = require ( '../../package.json' ) ;
8989 const DEFAULT_CONFIG : TraceWriterConfig = {
90+ authOptions : { } ,
9091 onUncaughtException : 'ignore' ,
9192 bufferSize : Infinity ,
9293 flushDelaySeconds : 3600 ,
@@ -174,17 +175,21 @@ describe('Trace Writer', () => {
174175 it ( 'should use the keyFilename field of the config object' , async ( ) => {
175176 const expectedCredentials : TestCredentials = require ( './fixtures/gcloud-credentials.json' ) ;
176177 const actualCredentials = await captureCredentialsForConfig ( {
177- projectId : 'my-project' ,
178- keyFilename : path . join ( 'test' , 'fixtures' , 'gcloud-credentials.json' ) ,
178+ authOptions : {
179+ projectId : 'my-project' ,
180+ keyFilename : path . join ( 'test' , 'fixtures' , 'gcloud-credentials.json' ) ,
181+ } ,
179182 } ) ;
180183 assert . deepStrictEqual ( actualCredentials , expectedCredentials ) ;
181184 } ) ;
182185
183186 it ( 'should use the credentials field of the config object' , async ( ) => {
184187 const expectedCredentials : TestCredentials = require ( './fixtures/gcloud-credentials.json' ) ;
185188 const actualCredentials = await captureCredentialsForConfig ( {
186- projectId : 'my-project' ,
187- credentials : expectedCredentials ,
189+ authOptions : {
190+ projectId : 'my-project' ,
191+ credentials : expectedCredentials ,
192+ } ,
188193 } ) ;
189194 assert . deepStrictEqual ( actualCredentials , expectedCredentials ) ;
190195 } ) ;
@@ -197,9 +202,11 @@ describe('Trace Writer', () => {
197202 type : 'authorized_user' ,
198203 } ;
199204 const actualCredentials = await captureCredentialsForConfig ( {
200- projectId : 'my-project' ,
201- keyFilename : path . join ( 'test' , 'fixtures' , 'gcloud-credentials.json' ) ,
202- credentials : expectedCredentials ,
205+ authOptions : {
206+ projectId : 'my-project' ,
207+ keyFilename : path . join ( 'test' , 'fixtures' , 'gcloud-credentials.json' ) ,
208+ credentials : expectedCredentials ,
209+ } ,
203210 } ) ;
204211 assert . deepStrictEqual ( actualCredentials , expectedCredentials ) ;
205212 } ) ;
@@ -216,7 +223,9 @@ describe('Trace Writer', () => {
216223
217224 it ( `doesn't call Service#getProjectId if project ID is passed` , async ( ) => {
218225 const writer = new TraceWriter (
219- Object . assign ( { projectId : 'my-project' } , DEFAULT_CONFIG ) ,
226+ Object . assign ( { } , DEFAULT_CONFIG , {
227+ authOptions : { projectId : 'my-project' } ,
228+ } ) ,
220229 logger
221230 ) ;
222231 getProjectIdOverride = ( ) => Promise . resolve ( 'my-different-project' ) ;
0 commit comments