mirror of
https://github.com/Kir-Antipov/mc-publish.git
synced 2024-11-25 01:41:05 -05:00
Added tests for platform-uploader
This commit is contained in:
parent
7fece35389
commit
bbcc4c4971
1 changed files with 19 additions and 0 deletions
19
tests/unit/platforms/platform-uploader.spec.ts
Normal file
19
tests/unit/platforms/platform-uploader.spec.ts
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
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'.");
|
||||||
|
});
|
||||||
|
});
|
Loading…
Reference in a new issue