@@ -14,6 +14,7 @@ describe('MetadataJson', () => {
1414 const metadata = {
1515 Repository : 'ScoopInstaller/Main' ,
1616 OfficialRepository : true ,
17+ OfficialRepositoryName : 'main' ,
1718 RepositoryStars : 5000 ,
1819 BranchName : 'master' ,
1920 FilePath : 'bucket/git.json' ,
@@ -25,6 +26,7 @@ describe('MetadataJson', () => {
2526
2627 expect ( result . repository ) . toBe ( 'ScoopInstaller/Main' ) ;
2728 expect ( result . repositoryOfficial ) . toBe ( true ) ;
29+ expect ( result . officialRepositoryName ) . toBe ( 'main' ) ;
2830 expect ( result . stars ) . toBe ( 5000 ) ;
2931 expect ( result . branchName ) . toBe ( 'master' ) ;
3032 expect ( result . filePath ) . toBe ( 'bucket/git.json' ) ;
@@ -46,6 +48,7 @@ describe('MetadataJson', () => {
4648
4749 expect ( result . repository ) . toBe ( 'user/repo' ) ;
4850 expect ( result . repositoryOfficial ) . toBe ( false ) ;
51+ expect ( result . officialRepositoryName ) . toBe ( '' ) ;
4952 expect ( result . stars ) . toBe ( 0 ) ;
5053 expect ( result . branchName ) . toBe ( '' ) ;
5154 } ) ;
@@ -66,6 +69,7 @@ describe('MetadataJson', () => {
6669 expect ( result . committed . getFullYear ( ) ) . toBe ( 2024 ) ;
6770 expect ( result . committed . getMonth ( ) ) . toBe ( 0 ) ; // January = 0
6871 expect ( result . committed . getDate ( ) ) . toBe ( 15 ) ;
72+ expect ( result . officialRepositoryName ) . toBe ( '' ) ;
6973 } ) ;
7074 } ) ;
7175
@@ -74,6 +78,7 @@ describe('MetadataJson', () => {
7478 const metadata = {
7579 Repository : 'ScoopInstaller/Main' ,
7680 OfficialRepository : true ,
81+ OfficialRepositoryName : 'main' ,
7782 RepositoryStars : 5000 ,
7883 FilePath : 'bucket/app.json' ,
7984 Committed : '2024-01-01T00:00:00Z' ,
@@ -83,6 +88,7 @@ describe('MetadataJson', () => {
8388 const result = jsonConvert . deserializeObject ( metadata , MetadataJson ) ;
8489
8590 expect ( result . repositoryOfficial ) . toBe ( true ) ;
91+ expect ( result . officialRepositoryName ) . toBe ( 'main' ) ;
8692 } ) ;
8793
8894 it ( 'should correctly identify non-official repository' , ( ) => {
@@ -98,6 +104,7 @@ describe('MetadataJson', () => {
98104 const result = jsonConvert . deserializeObject ( metadata , MetadataJson ) ;
99105
100106 expect ( result . repositoryOfficial ) . toBe ( false ) ;
107+ expect ( result . officialRepositoryName ) . toBe ( '' ) ;
101108 } ) ;
102109 } ) ;
103110
@@ -121,6 +128,7 @@ describe('MetadataJson', () => {
121128 const metadata = {
122129 Repository : 'popular/repo' ,
123130 OfficialRepository : true ,
131+ OfficialRepositoryName : 'extras' ,
124132 RepositoryStars : 999999 ,
125133 FilePath : 'bucket/app.json' ,
126134 Committed : '2024-01-01T00:00:00Z' ,
@@ -130,6 +138,7 @@ describe('MetadataJson', () => {
130138 const result = jsonConvert . deserializeObject ( metadata , MetadataJson ) ;
131139
132140 expect ( result . stars ) . toBe ( 999999 ) ;
141+ expect ( result . officialRepositoryName ) . toBe ( 'extras' ) ;
133142 } ) ;
134143 } ) ;
135144} ) ;
0 commit comments