@@ -86,12 +86,12 @@ describe("ComponentDetection.processComponentsToManifests", () => {
8686 } ,
8787 isDevelopmentDependency : false ,
8888 topLevelReferrers : [ ] , // Empty = direct dependency
89- locationsFoundAt : [ "/ package.json" ]
89+ locationsFoundAt : [ "package.json" ]
9090 }
9191 ] ;
9292
9393 const dependencyGraphs : DependencyGraphs = {
94- "/ package.json" : {
94+ "package.json" : {
9595 graph : { "test-package" : null } ,
9696 explicitlyReferencedComponentIds : [ "test-package 1.0.0 - npm" ] ,
9797 developmentDependencies : [ ] ,
@@ -102,7 +102,7 @@ describe("ComponentDetection.processComponentsToManifests", () => {
102102 const manifests = ComponentDetection . processComponentsToManifests ( componentsFound , dependencyGraphs ) ;
103103
104104 expect ( manifests ) . toHaveLength ( 1 ) ;
105- expect ( manifests [ 0 ] . name ) . toBe ( "/ package.json" ) ;
105+ expect ( manifests [ 0 ] . name ) . toBe ( "package.json" ) ;
106106 expect ( manifests [ 0 ] . directDependencies ( ) ) . toHaveLength ( 1 ) ;
107107 expect ( manifests [ 0 ] . indirectDependencies ( ) ) . toHaveLength ( 0 ) ;
108108 expect ( manifests [ 0 ] . countDependencies ( ) ) . toBe ( 1 ) ;
@@ -135,12 +135,12 @@ describe("ComponentDetection.processComponentsToManifests", () => {
135135 }
136136 }
137137 ] ,
138- locationsFoundAt : [ "/ package.json" ]
138+ locationsFoundAt : [ "package.json" ]
139139 }
140140 ] ;
141141
142142 const dependencyGraphs : DependencyGraphs = {
143- "/ package.json" : {
143+ "package.json" : {
144144 graph : { "parent-package" : null } ,
145145 explicitlyReferencedComponentIds : [ ] ,
146146 developmentDependencies : [ ] ,
@@ -151,7 +151,7 @@ describe("ComponentDetection.processComponentsToManifests", () => {
151151 const manifests = ComponentDetection . processComponentsToManifests ( componentsFound , dependencyGraphs ) ;
152152
153153 expect ( manifests ) . toHaveLength ( 1 ) ;
154- expect ( manifests [ 0 ] . name ) . toBe ( "/ package.json" ) ;
154+ expect ( manifests [ 0 ] . name ) . toBe ( "package.json" ) ;
155155 expect ( manifests [ 0 ] . directDependencies ( ) ) . toHaveLength ( 0 ) ;
156156 expect ( manifests [ 0 ] . indirectDependencies ( ) ) . toHaveLength ( 1 ) ;
157157 expect ( manifests [ 0 ] . countDependencies ( ) ) . toBe ( 1 ) ;
@@ -184,10 +184,11 @@ describe('normalizeDependencyGraphPaths', () => {
184184 const normalized = ComponentDetection . normalizeDependencyGraphPaths ( dependencyGraphs , filePathInput ) ;
185185 // Restore process.cwd
186186 ( process as any ) . cwd = originalCwd ;
187- expect ( Object . keys ( normalized ) ) . toContain ( '/a/package.json' ) ;
188- expect ( Object . keys ( normalized ) ) . toContain ( '/b/package.json' ) ;
189- expect ( normalized [ '/a/package.json' ] . graph ) . toEqual ( { 'foo' : null } ) ;
190- expect ( normalized [ '/b/package.json' ] . graph ) . toEqual ( { 'bar' : null } ) ;
187+ expect ( Object . keys ( normalized ) ) . toContain ( 'a/package.json' ) ;
188+ expect ( Object . keys ( normalized ) ) . toContain ( 'b/package.json' ) ;
189+ expect ( normalized [ 'a/package.json' ] . graph ) . toEqual ( { 'foo' : null } ) ;
190+ expect ( normalized [ 'b/package.json' ] . graph ) . toEqual ( { 'bar' : null } ) ;
191+ console . log ( normalized )
191192 } ) ;
192193} ) ;
193194
0 commit comments