@@ -233,9 +233,8 @@ describe('logging-bunyan', function() {
233233 } ) ;
234234
235235 it ( 'should promote prefixed trace property to metadata' , function ( done ) {
236- var recordWithRequest = extend ( {
237- 'logging.googleapis.com/trace' : 'trace1'
238- } , RECORD ) ;
236+ const recordWithTrace = extend ( { } , RECORD ) ;
237+ recordWithTrace [ LoggingBunyan . LOGGING_TRACE_KEY ] = 'trace1' ;
239238
240239 loggingBunyan . log_ . entry = function ( entryMetadata , record ) {
241240 assert . deepStrictEqual ( entryMetadata , {
@@ -248,7 +247,7 @@ describe('logging-bunyan', function() {
248247 done ( ) ;
249248 } ;
250249
251- loggingBunyan . formatEntry_ ( recordWithRequest ) ;
250+ loggingBunyan . formatEntry_ ( recordWithTrace ) ;
252251 } ) ;
253252 } ) ;
254253
@@ -285,9 +284,9 @@ describe('logging-bunyan', function() {
285284 getWriterProjectId : function ( ) { return 'project1' ; }
286285 } ;
287286 const recordWithoutTrace = extend ( { } , RECORD ) ;
288- const recordWithTrace = extend ( {
289- 'logging.googleapis.com/trace' : 'projects/project1/traces/trace1'
290- } , RECORD ) ;
287+ const recordWithTrace = extend ( { } , RECORD ) ;
288+ recordWithTrace [ LoggingBunyan . LOGGING_TRACE_KEY ] =
289+ 'projects/project1/traces/trace1' ;
291290
292291 FakeWritable . prototype . write = function ( record , encoding , callback ) {
293292 // Check that trace field added to record before calling Writable.write
@@ -306,14 +305,13 @@ describe('logging-bunyan', function() {
306305 } ) ;
307306
308307 it ( 'should leave prefixed trace property as is if set' , function ( done ) {
309- var oldTraceAgent = global . _google_trace_agent ;
308+ const oldTraceAgent = global . _google_trace_agent ;
310309 global . _google_trace_agent = {
311310 getCurrentContextId : function ( ) { return 'trace-from-agent' ; } ,
312311 getWriterProjectId : function ( ) { return 'project1' ; }
313312 } ;
314- const recordWithTraceAlreadySet = extend ( {
315- 'logging.googleapis.com/trace' : 'trace-already-set'
316- } , RECORD ) ;
313+ const recordWithTraceAlreadySet = extend ( { } , RECORD ) ;
314+ recordWithTraceAlreadySet [ LoggingBunyan . LOGGING_TRACE_KEY ] = 'trace1' ;
317315
318316 FakeWritable . prototype . write = function ( record , encoding , callback ) {
319317 assert . deepStrictEqual ( record , recordWithTraceAlreadySet ) ;
0 commit comments