File tree Expand file tree Collapse file tree 2 files changed +15
-4
lines changed
packages/opentelemetry-test-utils/src
plugins/node/opentelemetry-instrumentation-hapi/test Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -236,7 +236,7 @@ export async function runTestFixture(
236
236
const collector = new TestCollector ( ) ;
237
237
await collector . start ( ) ;
238
238
239
- return new Promise ( resolve => {
239
+ return new Promise ( ( resolve , reject ) => {
240
240
execFile (
241
241
process . execPath ,
242
242
opts . argv ,
@@ -261,6 +261,8 @@ export async function runTestFixture(
261
261
if ( opts . checkCollector ) {
262
262
await opts . checkCollector ( collector ) ;
263
263
}
264
+ } catch ( err ) {
265
+ reject ( err ) ;
264
266
} finally {
265
267
collector . close ( ) ;
266
268
resolve ( ) ;
Original file line number Diff line number Diff line change @@ -557,15 +557,24 @@ describe('Hapi Instrumentation - Core Tests', () => {
557
557
} ,
558
558
checkCollector : ( collector : TestCollector ) => {
559
559
const spans = collector . sortedSpans ;
560
- assert . strictEqual ( spans . length , 2 ) ;
561
- assert . strictEqual ( spans [ 0 ] . name , 'GET /route/{param}' ) ;
560
+
561
+ assert . strictEqual ( spans . length , 3 ) ;
562
+
563
+ assert . strictEqual ( spans [ 0 ] . name , 'GET' ) ;
562
564
assert . strictEqual (
563
565
spans [ 0 ] . instrumentationScope . name ,
564
566
'@opentelemetry/instrumentation-http'
565
567
) ;
566
- assert . strictEqual ( spans [ 1 ] . name , 'route - /route/{param}' ) ;
568
+
569
+ assert . strictEqual ( spans [ 1 ] . name , 'GET /route/{param}' ) ;
567
570
assert . strictEqual (
568
571
spans [ 1 ] . instrumentationScope . name ,
572
+ '@opentelemetry/instrumentation-http'
573
+ ) ;
574
+
575
+ assert . strictEqual ( spans [ 2 ] . name , 'route - /route/{param}' ) ;
576
+ assert . strictEqual (
577
+ spans [ 2 ] . instrumentationScope . name ,
569
578
'@opentelemetry/instrumentation-hapi'
570
579
) ;
571
580
} ,
You can’t perform that action at this time.
0 commit comments