mirror of
https://github.com/Kir-Antipov/mc-publish.git
synced 2024-11-25 09:51:01 -05:00
Added tests for github-release
This commit is contained in:
parent
ed2fbd8914
commit
67d2f2b2d8
1 changed files with 52 additions and 0 deletions
52
tests/unit/platforms/github/github-release.spec.ts
Normal file
52
tests/unit/platforms/github/github-release.spec.ts
Normal file
|
@ -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);
|
||||
});
|
||||
});
|
Loading…
Reference in a new issue