Skip to content

Commit 9281048

Browse files
committed
Include goproxy_server in configuration filtering tests
1 parent 6b83dc3 commit 9281048

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

lib/start-proxy.test.js

Lines changed: 5 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/start-proxy.test.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/start-proxy.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -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

130130
test("getCredentials throws an error when non-printable characters are used", async (t) => {

0 commit comments

Comments
 (0)