23 lines
763 B
TypeScript
23 lines
763 B
TypeScript
|
import { afterAll, afterEach, beforeAll, describe, expect, it } from "bun:test";
|
||
|
import DockerHub from "./DockerHub";
|
||
|
import server from "./mocks/dockerHubServer";
|
||
|
|
||
|
describe("DockerHub", () => {
|
||
|
beforeAll(() => server.listen());
|
||
|
afterEach(() => server.resetHandlers());
|
||
|
afterAll(() => server.close());
|
||
|
|
||
|
describe("getLatestVersions", () => {
|
||
|
it("should return the latest versions of an image", async () => {
|
||
|
const dockerHub = new DockerHub();
|
||
|
const versions = await dockerHub.getLatestVersions("vaultwarden/server");
|
||
|
expect(versions).toEqual([
|
||
|
"vaultwarden/server:1.30.5",
|
||
|
"vaultwarden/server:1.30.5-alpine",
|
||
|
"vaultwarden/server:latest",
|
||
|
"vaultwarden/server:latest-alpine",
|
||
|
]);
|
||
|
});
|
||
|
});
|
||
|
});
|