Skip to content

Commit 46e102d

Browse files
committed
add token & u/p test
1 parent 94ecfaf commit 46e102d

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

packages/testcontainers/src/container-runtime/auth/auths.test.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,5 +97,22 @@ describe("Auths", () => {
9797
};
9898
expect(await locator.getAuthConfig("https://registry.example.com", containerRuntimeConfig)).toEqual(authConfig);
9999
});
100+
101+
it("should use identity token when token and user and pass are provided", async () => {
102+
const containerRuntimeConfig: ContainerRuntimeConfig = {
103+
auths: {
104+
"https://registry.example.com": {
105+
identitytoken: "token-value",
106+
username: "user",
107+
password: "pass",
108+
},
109+
},
110+
};
111+
const authConfig: AuthConfig = {
112+
identityToken: "token-value",
113+
registryAddress: "https://registry.example.com",
114+
};
115+
expect(await locator.getAuthConfig("https://registry.example.com", containerRuntimeConfig)).toEqual(authConfig);
116+
});
100117
});
101118
});

0 commit comments

Comments
 (0)