diff --git a/tests/unit/platforms/github/github-release.spec.ts b/tests/unit/platforms/github/github-release.spec.ts new file mode 100644 index 0000000..d53070e --- /dev/null +++ b/tests/unit/platforms/github/github-release.spec.ts @@ -0,0 +1,52 @@ +import { packGitHubReleasePatch, packGitHubReleaseInit } from "@/platforms/github/github-release"; + +describe("packGitHubReleasePatch", () => { + test("packs release patch", () => { + const release = { + owner: "owner", + repo: "repo", + id: 1, + tag_name: "v1.0.0", + name: "Release 1.0.0", + body: "Release notes", + draft: false, + prerelease: false, + assets: [], + }; + + const expected = { + tag_name: "v1.0.0", + name: "Release 1.0.0", + body: "Release notes", + draft: false, + prerelease: false, + }; + + expect(packGitHubReleasePatch(release)).toEqual(expected); + }); +}); + +describe("packGitHubReleaseInit", () => { + test("packs release data", () => { + const release = { + owner: "owner", + repo: "repo", + tag_name: "v1.0.0", + name: "Release 1.0.0", + body: "Release notes", + draft: false, + prerelease: false, + assets: [], + }; + + const expected = { + tag_name: "v1.0.0", + name: "Release 1.0.0", + body: "Release notes", + draft: false, + prerelease: false, + }; + + expect(packGitHubReleaseInit(release)).toEqual(expected); + }); +});