mirror of
https://github.com/Kir-Antipov/mc-publish.git
synced 2024-11-26 02:11:04 -05:00
20 lines
787 B
TypeScript
20 lines
787 B
TypeScript
|
import { GitHubContext } from "@/platforms/github/github-context";
|
||
|
import { PlatformType } from "@/platforms/platform-type";
|
||
|
import { createPlatformUploader } from "@/platforms/platform-uploader";
|
||
|
|
||
|
describe("createPlatformUploader", () => {
|
||
|
test("creates an uploader for every known platform", () => {
|
||
|
const options = {
|
||
|
githubContext: { repo: "" } as unknown as GitHubContext,
|
||
|
};
|
||
|
|
||
|
for (const platform of PlatformType.values()) {
|
||
|
expect(createPlatformUploader(platform, options)).toBeDefined();
|
||
|
}
|
||
|
});
|
||
|
|
||
|
test("throws an error when an unknown platform is provided", () => {
|
||
|
expect(() => createPlatformUploader("unknown" as PlatformType, { githubContext: null })).toThrow("Unknown platform 'unknown'.");
|
||
|
});
|
||
|
});
|