@@ -122,8 +122,8 @@ test('helper functions', () => {
122
122
123
123
test ( 'distributed tracing trace context' , async ( t ) => {
124
124
const testCases = require ( '../../lib/cross_agent_tests/distributed_tracing/trace_context.json' )
125
- for ( const [ i ] of testCases . entries ( ) ) {
126
- await runTestCase ( testCases [ i ] , t )
125
+ for ( const testCase of testCases ) {
126
+ await runTestCase ( testCase , t )
127
127
}
128
128
} )
129
129
@@ -190,8 +190,7 @@ const testExpectedFixtureKeys = function (thingWithKeys, expectedKeys) {
190
190
if ( ! Array . isArray ( actualKeys ) ) {
191
191
actualKeys = Object . keys ( thingWithKeys )
192
192
}
193
- for ( const [ i ] of actualKeys . entries ( ) ) {
194
- const key = actualKeys [ i ]
193
+ for ( const key of actualKeys ) {
195
194
assert . ok ( expectedKeys . indexOf ( key ) !== - 1 , 'key [' + key + '] should be expected?' )
196
195
}
197
196
}
@@ -282,8 +281,7 @@ async function runTestCase(testCase, parentTest) {
282
281
] )
283
282
284
283
if ( testCase . outbound_payloads ) {
285
- for ( const [ i ] of testCase . outbound_payloads . entries ( ) ) {
286
- const outboundPayload = testCase . outbound_payloads [ i ]
284
+ for ( const outboundPayload of testCase . outbound_payloads ) {
287
285
testExpectedFixtureKeys ( outboundPayload , [
288
286
'exact' ,
289
287
'expected' ,
@@ -311,8 +309,7 @@ async function runTestCase(testCase, parentTest) {
311
309
testExpectedFixtureKeys ( testCase . intrinsics . target_events , expectedEvents )
312
310
313
311
// test the top level keys of each event
314
- for ( const [ i ] of testCase . intrinsics . target_events . entries ( ) ) {
315
- const event = testCase . intrinsics . target_events [ i ]
312
+ for ( const event of testCase . intrinsics . target_events ) {
316
313
const eventTestConfig = testCase . intrinsics [ event ]
317
314
318
315
// a few tests list an expected event, but no data for that event
@@ -363,9 +360,7 @@ async function runTestCase(testCase, parentTest) {
363
360
}
364
361
}
365
362
366
- for ( const [ key ] of testCase . inbound_headers . entries ( ) ) {
367
- const inboundHeader = testCase . inbound_headers [ key ]
368
-
363
+ for ( const inboundHeader of testCase . inbound_headers . values ( ) ) {
369
364
transaction . acceptDistributedTraceHeaders ( testCase . transport_type , inboundHeader )
370
365
371
366
// Generate outbound payloads
0 commit comments