@@ -44,12 +44,29 @@ describe("utils.getLinks", () => {
4444 type : "git" ,
4545 url : "github.com/foo/bar"
4646 }
47- } as any ) , {
47+ } as PackumentVersion ) , {
4848 npm : "https://www.npmjs.com/package/foo/v/1.0.0" ,
4949 homepage : "https://github.com/foo/bar" ,
5050 repository : "https://github.com/foo/bar"
5151 } ) ;
5252 } ) ;
53+
54+ it ( "repository url should prioritize repository over homepage" , ( ) => {
55+ assert . deepStrictEqual ( utils . getLinks ( {
56+ name : "@nodesecure/utils" ,
57+ version : "2.3.0" ,
58+ homepage : "https://github.com/NodeSecure/tree/master/workspaces/utils#readme" ,
59+ repository : {
60+ type : "git" ,
61+ url : "https://github.com/NodeSecure/scanner" ,
62+ directory : "workspaces/utils"
63+ }
64+ } as PackumentVersion ) , {
65+ npm : "https://www.npmjs.com/package/@nodesecure/utils/v/2.3.0" ,
66+ homepage : "https://github.com/NodeSecure/tree/master/workspaces/utils#readme" ,
67+ repository : "https://github.com/NodeSecure/scanner"
68+ } ) ;
69+ } ) ;
5370} ) ;
5471
5572describe ( "utils.getManifestLinks" , ( ) => {
@@ -94,4 +111,21 @@ describe("utils.getManifestLinks", () => {
94111 repository : "https://github.com/foo/bar"
95112 } ) ;
96113 } ) ;
114+
115+ it ( "repository url should prioritize repository over homepage" , ( ) => {
116+ assert . deepStrictEqual ( utils . getManifestLinks ( {
117+ name : "@nodesecure/utils" ,
118+ version : "2.3.0" ,
119+ homepage : "https://github.com/NodeSecure/tree/master/workspaces/utils#readme" ,
120+ repository : {
121+ type : "git" ,
122+ url : "https://github.com/NodeSecure/scanner" ,
123+ directory : "workspaces/utils"
124+ }
125+ } ) , {
126+ npm : null ,
127+ homepage : "https://github.com/NodeSecure/tree/master/workspaces/utils#readme" ,
128+ repository : "https://github.com/NodeSecure/scanner"
129+ } ) ;
130+ } ) ;
97131} ) ;
0 commit comments