From e114998dda50da2593c88048fc375e5e19f500c8 Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Wed, 11 Feb 2026 17:15:45 +0000 Subject: [PATCH] Add test for missing type --- src/start-proxy.test.ts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/start-proxy.test.ts b/src/start-proxy.test.ts index 9d2902bcc..321a41a29 100644 --- a/src/start-proxy.test.ts +++ b/src/start-proxy.test.ts @@ -175,6 +175,27 @@ test("getCredentials throws error when credential is not an object", async (t) = } }); +test("getCredentials throws error when credential is missing type", async (t) => { + const testCredentials = [[{ token: "abc", url: "https://localhost" }]].map( + toEncodedJSON, + ); + + for (const testCredential of testCredentials) { + t.throws( + () => + startProxyExports.getCredentials( + getRunnerLogger(true), + undefined, + testCredential, + undefined, + ), + { + message: "Invalid credentials - must have a type", + }, + ); + } +}); + test("getCredentials throws error when credential missing host and url", async (t) => { const testCredentials = [ [{ type: "npm_registry", token: "abc" }],