@@ -96,12 +96,13 @@ test("getCredentials filters by language when specified", async (t) => {
9696 { type : "npm_registry" , host : "npm.pkg.github.com" , token : "abc" } ,
9797 { type : "maven_repository" , host : "maven.pkg.github.com" , token : "def" } ,
9898 { type : "nuget_feed" , host : "nuget.pkg.github.com" , token : "ghi" } ,
99+ { type : "goproxy_server" , host : "goproxy.example.com" , token : "jkl" } ,
99100 ] ;
100101
101102 const credentials = startProxyExports . getCredentials (
102103 getRunnerLogger ( true ) ,
103104 undefined ,
104- Buffer . from ( JSON . stringify ( mixedCredentials ) ) . toString ( "base64" ) ,
105+ toEncodedJSON ( mixedCredentials ) ,
105106 "java" ,
106107 ) ;
107108 t . is ( credentials . length , 1 ) ;
@@ -113,18 +114,17 @@ test("getCredentials returns all credentials when no language specified", async
113114 { type : "npm_registry" , host : "npm.pkg.github.com" , token : "abc" } ,
114115 { type : "maven_repository" , host : "maven.pkg.github.com" , token : "def" } ,
115116 { type : "nuget_feed" , host : "nuget.pkg.github.com" , token : "ghi" } ,
117+ { type : "goproxy_server" , host : "goproxy.example.com" , token : "jkl" } ,
116118 ] ;
117- const credentialsInput = Buffer . from (
118- JSON . stringify ( mixedCredentials ) ,
119- ) . toString ( "base64" ) ;
119+ const credentialsInput = toEncodedJSON ( mixedCredentials ) ;
120120
121121 const credentials = startProxyExports . getCredentials (
122122 getRunnerLogger ( true ) ,
123123 undefined ,
124124 credentialsInput ,
125125 undefined ,
126126 ) ;
127- t . is ( credentials . length , 3 ) ;
127+ t . is ( credentials . length , mixedCredentials . length ) ;
128128} ) ;
129129
130130test ( "getCredentials throws an error when non-printable characters are used" , async ( t ) => {
0 commit comments