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(
236236 const collector = new TestCollector ( ) ;
237237 await collector . start ( ) ;
238238
239- return new Promise ( resolve => {
239+ return new Promise ( ( resolve , reject ) => {
240240 execFile (
241241 process . execPath ,
242242 opts . argv ,
@@ -261,6 +261,8 @@ export async function runTestFixture(
261261 if ( opts . checkCollector ) {
262262 await opts . checkCollector ( collector ) ;
263263 }
264+ } catch ( err ) {
265+ reject ( err ) ;
264266 } finally {
265267 collector . close ( ) ;
266268 resolve ( ) ;
Original file line number Diff line number Diff line change @@ -557,15 +557,24 @@ describe('Hapi Instrumentation - Core Tests', () => {
557557 } ,
558558 checkCollector : ( collector : TestCollector ) => {
559559 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' ) ;
562564 assert . strictEqual (
563565 spans [ 0 ] . instrumentationScope . name ,
564566 '@opentelemetry/instrumentation-http'
565567 ) ;
566- assert . strictEqual ( spans [ 1 ] . name , 'route - /route/{param}' ) ;
568+
569+ assert . strictEqual ( spans [ 1 ] . name , 'GET /route/{param}' ) ;
567570 assert . strictEqual (
568571 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 ,
569578 '@opentelemetry/instrumentation-hapi'
570579 ) ;
571580 } ,
You can’t perform that action at this time.
0 commit comments