@@ -393,16 +393,18 @@ suite('populateTestTree tests', () => {
393393 } ;
394394
395395 const rootChildrenAddStub = sandbox . stub ( ) ;
396+ const rootChildrenGetStub = sandbox . stub ( ) . returns ( undefined ) ;
396397 const mockRootItem : TestItem = {
397- children : { add : rootChildrenAddStub } ,
398+ children : { add : rootChildrenAddStub , get : rootChildrenGetStub } ,
398399 } as any ;
399400
400401 const nestedChildrenAddStub = sandbox . stub ( ) ;
402+ const nestedChildrenGetStub = sandbox . stub ( ) . returns ( undefined ) ;
401403 const mockNestedNode : TestItem = {
402404 id : 'nested-id' ,
403405 canResolveChildren : true ,
404406 tags : [ ] ,
405- children : { add : nestedChildrenAddStub } ,
407+ children : { add : nestedChildrenAddStub , get : nestedChildrenGetStub } ,
406408 } as any ;
407409
408410 const mockNestedTestItem : TestItem = {
@@ -460,14 +462,15 @@ suite('populateTestTree tests', () => {
460462 } ;
461463
462464 const rootChildrenAddStub = sandbox . stub ( ) ;
463- const mockRootItem : TestItem = {
464- children : { add : rootChildrenAddStub } ,
465- } as any ;
466-
467465 const existingChildrenAddStub = sandbox . stub ( ) ;
466+ const existingChildrenGetStub = sandbox . stub ( ) . returns ( undefined ) ;
468467 const existingNode : TestItem = {
469468 id : 'existing-id' ,
470- children : { add : existingChildrenAddStub } ,
469+ children : { add : existingChildrenAddStub , get : existingChildrenGetStub } ,
470+ } as any ;
471+ const rootChildrenGetStub = sandbox . stub ( ) . withArgs ( 'existing-id' ) . returns ( existingNode ) ;
472+ const mockRootItem : TestItem = {
473+ children : { add : rootChildrenAddStub , get : rootChildrenGetStub } ,
471474 } as any ;
472475
473476 const mockTestItem : TestItem = {
@@ -597,14 +600,14 @@ suite('populateTestTree tests', () => {
597600 id : 'root-id' ,
598601 tags : [ ] ,
599602 canResolveChildren : true ,
600- children : { add : sandbox . stub ( ) } ,
603+ children : { add : sandbox . stub ( ) , get : sandbox . stub ( ) . returns ( undefined ) } ,
601604 } as any ;
602605
603606 const mockNestedNode : TestItem = {
604607 id : 'nested-id' ,
605608 tags : [ ] ,
606609 canResolveChildren : true ,
607- children : { add : sandbox . stub ( ) } ,
610+ children : { add : sandbox . stub ( ) , get : sandbox . stub ( ) . returns ( undefined ) } ,
608611 } as any ;
609612
610613 const mockTestItem : TestItem = {
0 commit comments