@@ -96,12 +96,13 @@ test("getCredentials filters by language when specified", async (t) => {
96
96
{ type : "npm_registry" , host : "npm.pkg.github.com" , token : "abc" } ,
97
97
{ type : "maven_repository" , host : "maven.pkg.github.com" , token : "def" } ,
98
98
{ type : "nuget_feed" , host : "nuget.pkg.github.com" , token : "ghi" } ,
99
+ { type : "goproxy_server" , host : "goproxy.example.com" , token : "jkl" } ,
99
100
] ;
100
101
101
102
const credentials = startProxyExports . getCredentials (
102
103
getRunnerLogger ( true ) ,
103
104
undefined ,
104
- Buffer . from ( JSON . stringify ( mixedCredentials ) ) . toString ( "base64" ) ,
105
+ toEncodedJSON ( mixedCredentials ) ,
105
106
"java" ,
106
107
) ;
107
108
t . is ( credentials . length , 1 ) ;
@@ -113,18 +114,17 @@ test("getCredentials returns all credentials when no language specified", async
113
114
{ type : "npm_registry" , host : "npm.pkg.github.com" , token : "abc" } ,
114
115
{ type : "maven_repository" , host : "maven.pkg.github.com" , token : "def" } ,
115
116
{ type : "nuget_feed" , host : "nuget.pkg.github.com" , token : "ghi" } ,
117
+ { type : "goproxy_server" , host : "goproxy.example.com" , token : "jkl" } ,
116
118
] ;
117
- const credentialsInput = Buffer . from (
118
- JSON . stringify ( mixedCredentials ) ,
119
- ) . toString ( "base64" ) ;
119
+ const credentialsInput = toEncodedJSON ( mixedCredentials ) ;
120
120
121
121
const credentials = startProxyExports . getCredentials (
122
122
getRunnerLogger ( true ) ,
123
123
undefined ,
124
124
credentialsInput ,
125
125
undefined ,
126
126
) ;
127
- t . is ( credentials . length , 3 ) ;
127
+ t . is ( credentials . length , mixedCredentials . length ) ;
128
128
} ) ;
129
129
130
130
test ( "getCredentials throws an error when non-printable characters are used" , async ( t ) => {
0 commit comments